[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:26:15 CET 2016


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.

I also disagree with your analysis, all other avio_seek I could find
> are under if (pb->seekable), even if it is sometimes quite non-obvious.

Yes, I've noticed that.

> Also it might be helpful for you to have a look at tests/fate/demux.mak
> and tests/fate/video.mak and use copy-paste to write some basic tests
> for all the things you implement, so it doesn't get broken the moment
> you look the other way...

Yes, but I'm completely new at writing FATE tests, and it seems very 
complex to me, so I'll take a rain check on that one. Hopefully Michael 
will be able to add some good tests for the palette stuff, when he's got 
the time for it.

Mats



More information about the ffmpeg-devel mailing list