[MPlayer-dev-eng] Re: [PATCH] demuxers: move resync_audio_stream call to demuxer.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Oct 14 23:19:46 CEST 2005


Hi,
On Fri, Oct 14, 2005 at 11:12:53PM +0200, Alban Bedel wrote:
> On Fri, 14 Oct 2005 21:38:46 +0200
> Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> > demuxer.c is still missing the prototype for the resync_audio_stream.
> > Would you find a special prototype or #include "libmpcodecs/dec_audio.h"
> > preferable?
> 
> libmpdemux is supposed to work "standalone", so unless dec_audio.h is
> alredy included somewhere else a prototype is probably better.

Ok, that's also how the demuxers did it.

> imho it's probably better to only calls resync_audio_stream() if something
> did happend (or at least was supposed to) as in: 
> 
> -if (demuxer->desc->seek)
> +if (demuxer->desc->seek) {
>      demuxer->desc->seek(demuxer,rel_seek_secs,flags);
>  
> +    if (sh_audio) resync_audio_stream(sh_audio);
> +}

Agreed.

> and
> 
>      if (res == DEMUXER_CTRL_NOTIMPL)
>        index = demuxer->audio->id;
> +    else if (demuxer->audio) resync_audio_stream(demuxer->audio);

I am against the
if (demuxer->audio)
check since the code (e.g. above) assumes this is the case. As one of
the people doing a lot of debugging I prefer code to crash when used in
a way it wasn't supposed to be used instead of doing something
senseless.

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list