[FFmpeg-devel] [PATCH] Set the eof flag if a fskip call fails

Martin Storsjö martin
Tue Jul 20 19:11:16 CEST 2010


On Tue, 20 Jul 2010, Reimar D?ffinger wrote:

> On Mon, Jul 19, 2010 at 09:35:16PM +0300, Martin Storsj? wrote:
> > If you think of fskip as fseek(cur), then yes, it should behave in the 
> > same way, not setting the eof flag (unless it happens to do the seek by 
> > reading, when it actually is set). If you instead think of fskip as 
> > "advance the read pointer by reading x bytes but do not return them", 
> > setting the eof flag if it fails would be the semantically correct thing.
> 
> That's not the way it is used though, in particular it is also used
> with negative numbers.

Oh, good point.

> The way it's really used is more "this is really only a tiny little seek,
> so it should never fail and it's ok to just skip the error checking".

True, and as long as the seek forward is less than SHORT_SEEK_THRESHOLD, 
it should always be done with a read internally and trigger the eof flag 
if something went wrong anyway.

Consider the patch dropped then, I'll see if there are other cases in the 
flvdec demuxer that needs better error checking, that aren't (necessarily) 
handled by the short seek code.

// Martin



More information about the ffmpeg-devel mailing list