[MPlayer-dev-eng] Re: [PATCH] demuxers: move resync_audio_stream call to demuxer.c
kiriuja
mplayer-patches at en-directo.net
Sat Oct 15 02:10:05 CEST 2005
On Friday 14 October 2005 17:12 Alban Bedel wrote:
> imho it's probably better to only calls resync_audio_stream() if something
> did happend (or at least was supposed to) as in:
>
> ...
>
> if (res == DEMUXER_CTRL_NOTIMPL)
> index = demuxer->audio->id;
> + else if (demuxer->audio) resync_audio_stream(demuxer->audio);
> return index;
>
> Albeu
In this case even if the control is implemented it may not switch
to a different audio track, for example if there is no other track
with identical parameters or no other track at all.
So ideally you would do something like:
+ int oldid = demuxer->audio->id;
int res = demux_control(demuxer, DEMUXER_CTRL_SWITCH_AUDIO, &index);
if (res == DEMUXER_CTRL_NOTIMPL)
index = demuxer->audio->id;
+ else if (demuxer->audio->id != oldid)
+ resync_audio_stream(demuxer->audio);
return index;
--
kiriuja
More information about the MPlayer-dev-eng
mailing list