[MPlayer-dev-eng] [PATCH] Allow EDL's to work better with Audio

Roger Pack rogerdpack2 at gmail.com
Wed Apr 18 19:12:21 CEST 2012


> Currently EDL relies on mpctx->sh_video->pts which (as noted earlier)
> can "reset" half way through a DVD, thus applying skips or mutes to
> any segment past that mark doesn't work.  Patch to remedy this.

And a patch to enable audio (based on
http://lists-archives.com/mplayer-dev-eng/34938-allow-edls-to-work-on-audio-files-fwd.html)
to follow-on the above patch:

https://github.com/rdp/mplayer-svn/commit/87b51deb6bd82a226506af43905400b67189b46c

Thanks!
-roger-

diff --git a/help/help_mp-en.h b/help/help_mp-en.h
index 0958a04..734ee52 100644
--- a/help/help_mp-en.h
+++ b/help/help_mp-en.h
@@ -196,7 +196,7 @@
 #define MSGTR_EdlQueueEmpty "There are no EDL actions to take care of.\n"
 #define MSGTR_EdlCantOpenForWrite "Can't open EDL file [%s] for writing.\n"
 #define MSGTR_EdlCantOpenForRead "Can't open EDL file [%s] for reading.\n"
-#define MSGTR_EdlNOsh_video "Cannot use EDL without video, disabling.\n"
+#define MSGTR_EdlNOsh_video "Cannot use EDL without either video or
audio, disabling.\n"
 #define MSGTR_EdlNOValidLine "Invalid EDL line: %s\n"
 #define MSGTR_EdlBadlyFormattedLine "Badly formatted EDL line [%d],
discarding.\n"
 #define MSGTR_EdlBadLineOverlap "Last stop position was [%f]; next
start is [%f].\n"\
diff --git a/mplayer.c b/mplayer.c
index 38f023c..8f9d62a 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2598,10 +2598,15 @@ static void edl_loadfile(void)
 // Execute EDL command for the current position if one exists
 static void edl_update(MPContext *mpctx)
 {
+    double pts;
     if (!edl_records)
         return;

-    if (!mpctx->sh_video) {
+    if(mpctx->sh_video)
+      pts = demuxer_get_current_time(mpctx->demuxer);
+    else if (mpctx->sh_audio)
+      pts = playing_audio_pts(mpctx->sh_audio, mpctx->d_audio,
mpctx->audio_out);
+    else {
         mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlNOsh_video);
         free_edl(edl_records);
         next_edl_record = NULL;
@@ -2609,7 +2614,6 @@ static void edl_update(MPContext *mpctx)
         return;
     }
 	
-    double pts = demuxer_get_current_time(mpctx->demuxer);	
     // This indicates that we need to reset next EDL record according
     // to new PTS due to seek or other condition
     if (edl_needs_reset) {


More information about the MPlayer-dev-eng mailing list