[FFmpeg-devel] [PATCH] libavformat: not treat 0 as EOF

James Almer jamrial at gmail.com
Tue Oct 24 22:43:35 EEST 2017


On 10/24/2017 4:37 PM, Jan Ekstrom wrote:
> On Tue, Oct 24, 2017 at 10:17 PM, Nicolas George <george at nsup.org> wrote:
>> Le tridi 3 brumaire, an CCXXVI, Jan Ekstrom a écrit :
>> I do not consider this a public API change because 0 was never
>> documented as a valid return value for a read_packet callback, while
>> AVERROR_EOF has been around for a long time.
>>
> 
> You might be very true, but funny enough I just checked the AVIO
> example doc/examples/avio_reading.c, and the read function there does
> not seem to utilize AVERROR_EOF either :) .
> 
>> But my goal is not to break existing code on purpose. Fortunately, there
>> is a rather simple workaround, I will try to implement it tomorrow.
>> Still, lacking a simple test case, I will not be able to test it.
>>
> 
> Just for your information, I decided to call people out a bit on the
> IRC channel to see what people would prefer, and it seems like James,
> BtbN and Martin voiced their opinion that they would like a flag that
> would let you enable the 0 != EOF behavior. Additionally, a warning
> would be given out if zero is returned and the flag is unset.

Maybe first ask what the workaround Nicolas mentioned is about?

And preferably don't quote me on this subject. This is not my area of
expertise and i simply gave a suggestion to keep the old behavior at
least for a while, assuming this is an API break. And my suggestion was
in fact the opposite of what everyone else agreed on in the end.


More information about the ffmpeg-devel mailing list