Mercurial > mplayer.hg
comparison mplayer.c @ 31957:49848f9a8f30
Add -edl-start-pts option to Adjust positions in EDL records according
to file's start time. Patch by Vlad Seryakov, vseryakov at gmail.
author | reynaldo |
---|---|
date | Fri, 03 Sep 2010 23:49:35 +0000 |
parents | a6c25d94e60e |
children | 52509abc73e6 |
comparison
equal
deleted
inserted
replaced
31956:a6c25d94e60e | 31957:49848f9a8f30 |
---|---|
140 int slave_mode=0; | 140 int slave_mode=0; |
141 int player_idle_mode=0; | 141 int player_idle_mode=0; |
142 int quiet=0; | 142 int quiet=0; |
143 int enable_mouse_movements=0; | 143 int enable_mouse_movements=0; |
144 float start_volume = -1; | 144 float start_volume = -1; |
145 | 145 double start_pts = MP_NOPTS_VALUE; |
146 char *heartbeat_cmd; | 146 char *heartbeat_cmd; |
147 | 147 |
148 #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5)) | 148 #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5)) |
149 | 149 |
150 | 150 |
337 // of EDL scene in backward direction. This is needed to | 337 // of EDL scene in backward direction. This is needed to |
338 // have some time after the seek to decide what to do next | 338 // have some time after the seek to decide what to do next |
339 // (next seek, pause,...), otherwise after the seek it will | 339 // (next seek, pause,...), otherwise after the seek it will |
340 // enter the same scene again and skip forward immediately | 340 // enter the same scene again and skip forward immediately |
341 float edl_backward_delay = 2; | 341 float edl_backward_delay = 2; |
342 int edl_start_pts = 0; ///< Automatically add/sub this from EDL start/stop pos | |
342 int use_filedir_conf; | 343 int use_filedir_conf; |
343 int use_filename_title; | 344 int use_filename_title; |
344 | 345 |
345 static unsigned int initialized_flags=0; | 346 static unsigned int initialized_flags=0; |
346 | 347 |
553 return meta; | 554 return meta; |
554 } | 555 } |
555 | 556 |
556 static void print_file_properties(const MPContext *mpctx, const char *filename) | 557 static void print_file_properties(const MPContext *mpctx, const char *filename) |
557 { | 558 { |
558 double start_pts = MP_NOPTS_VALUE; | |
559 double video_start_pts = MP_NOPTS_VALUE; | 559 double video_start_pts = MP_NOPTS_VALUE; |
560 mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_FILENAME=%s\n", | 560 mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_FILENAME=%s\n", |
561 filename_recode(filename)); | 561 filename_recode(filename)); |
562 mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_DEMUXER=%s\n", mpctx->demuxer->desc->name); | 562 mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_DEMUXER=%s\n", mpctx->demuxer->desc->name); |
563 if (mpctx->sh_video) { | 563 if (mpctx->sh_video) { |
3638 } | 3638 } |
3639 } | 3639 } |
3640 | 3640 |
3641 print_file_properties(mpctx, filename); | 3641 print_file_properties(mpctx, filename); |
3642 | 3642 |
3643 // Adjust EDL positions with start_pts | |
3644 if (edl_start_pts && start_pts) { | |
3645 edl_record_ptr edl = edl_records; | |
3646 while (edl) { | |
3647 edl->start_sec += start_pts; | |
3648 edl->stop_sec += start_pts; | |
3649 edl = edl->next; | |
3650 } | |
3651 } | |
3652 | |
3643 if(!mpctx->sh_video) goto main; // audio-only | 3653 if(!mpctx->sh_video) goto main; // audio-only |
3644 | 3654 |
3645 if(!reinit_video_chain()) { | 3655 if(!reinit_video_chain()) { |
3646 if(!mpctx->sh_video){ | 3656 if(!mpctx->sh_video){ |
3647 if(!mpctx->sh_audio) goto goto_next_file; | 3657 if(!mpctx->sh_audio) goto goto_next_file; |