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

Mats Peterson matsp888 at yahoo.com
Sun Feb 28 12:33:16 CET 2016


On 02/28/2016 12:26 PM, Mats Peterson wrote:
> On 02/28/2016 12:16 PM, Reimar Döffinger wrote:
>>> And Reimar, the AVI muxer libavformat/avienc.c uses *lots* of
>>> avio_seek()
>>> all over the place, so it won't work well on stdout regardless of my
>>> patch.
>>> I have checked for avio_seek() returning >= 0 in my part of the code
>>> in any
>>> case, but it won't make much of a difference.
>>
>> I think the effect of a failed avio_seek is kind of undefined, so
>> checking the result is not really right as by then it's already broken.
>>
>
> 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?

Mats



More information about the ffmpeg-devel mailing list