[FFmpeg-devel] [PATCH] avidec: index also AVDISCARD_ALL streams

Reimar Döffinger Reimar.Doeffinger
Wed Aug 19 13:52:56 CEST 2009

On Wed, Aug 19, 2009 at 12:16:49PM +0200, Michael Niedermayer wrote:
> On Wed, Aug 19, 2009 at 08:36:45AM +0200, Reimar D?ffinger wrote:
> > Sample file in incoming/bugz1534
> > Does this design seem right to you?
> i have one big question before i can really say anything about the
> patch,
> why are the timestamps wrong if this code is run?

Ups, the timestamp issue was with the MPlayer demuxer. Bad messup.
There is the issue that I think this file is badly interleaved and thus stream
switching discards a lot of data, leading to strong desync.
That can't really be helped, or at least that is MPlayer's problem.
The issue I can see though (I lack a test case so far) is that for
a non-interleaved file AV_DISCARD_ALL might drop all packets at once,
since in avi_read_packet it will do "goto resync" until a packet from a
not-discarded stream is encountered.
Over http this also seems like quite a waste of bandwidth.
Should the "resync:" label maybe be further up, before the
non-interleaved handling? (I know, hard to say without a sample,
but give an opinion and I might try to find a sample if you're not
There is also another issue: loading that file takes ages, because
it is truncated and thus in avi_load_index the url_fseek and url_fskip
fail all the time (because the target is beyond the end of file, but
this does not set eof_reached).
Now for url_fseek this can easily be fixed, but url_fskip does not
return an error, so how is this supposed to be done?
Should url_fskip set eof_reached when url_fseek fails? Or should it have
a return value? Or...?

Reimar D?ffinger

More information about the ffmpeg-devel mailing list