[FFmpeg-devel] [PATCH v3 1/2] lavf/avienc: Add support for palette side data packets

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Feb 28 12:59:20 CET 2016


On Sun, Feb 28, 2016 at 12:33:16PM +0100, Mats Peterson wrote:
> On 02/28/2016 12:26 PM, Mats Peterson wrote:
> >On 02/28/2016 12:16 PM, Reimar Döffinger wrote:
> >Well, the documentation says that avio_seek() is a variant of the
> >fseek() function. I would rather say it's a variant of lseek(), since it
> >returns the new position, not just 0 or -1. In any case, this is what
> >the lseek() man page says:
> >
> >"On error, the value (off_t) -1 is returned and  errno  is  set  to
> >indicate the error."
> >
> >So it's not really undefined.
> >
> 
> Even if the return value is not undefined on error from an avio_seek(),
> would you prefer using pb->seekable instead of invoking an avio_seek()
> function that will fail? Is it more elegant to you?

I never said the return value was undefined, I said its
behaviour (i.e. what it did to your stream) is undefined.
E.g. it might have seeked back by the size of cached data
instead of to the place you wanted.
That's why checking pb->seekable is the only way fairly
sure to not produce incorrect results.


More information about the ffmpeg-devel mailing list