[MPlayer-dev-eng] [PATCH] Allow EDL's to work better with Audio
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Fri Apr 20 20:32:34 CEST 2012
On Wed, Apr 18, 2012 at 11:12:21AM -0600, Roger Pack wrote:
> > 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 {
You mailer mangled the patch so it won't apply cleanly.
Could you merge it with the patch that changes the code to use
demuxer_get_current_time in the first place?
I applied everything from that which did not change behaviour,
so it should be a nice small change I think.
More information about the MPlayer-dev-eng
mailing list