[FFmpeg-devel] [PATCH v2] avcodec/bsf: Set EOF flag only if pkt == NULL

Jan Sebechlebsky sebechlebskyjan at gmail.com
Tue Jul 26 13:36:46 EEST 2016

On 07/25/2016 05:14 PM, Nicolas George wrote:

> Le septidi 7 thermidor, an CCXXIV, Jan Sebechlebsky a écrit :
>> I gave this a second thought, wouldn't it be better to simply ignore pkt
>> without payload? So after caller would send empty packet using
>> av_bsf_send_packet, he would get AVERROR(EAGAIN) from the next
>> av_bsf_receive_packet call (from the definition in documentation
>> AVERROR(EAGAIN) means "more data needed" when returned by
>> av_bsf_receive_packet).
>> However, if you think it is better to reserve packet without payload for
>> some future use, I won't object.
> Both are possible, it is a matter of balance between convenience for us and
> convenience for the applications.
> If at some point someone finds a way to use that kind of packet. If they
> used to be ignored, it makes an incompatible API change. If they used to be
> forbidden, it works.
> The same logic applies for functions that return 0 for success or an AVERROR
> code: the documentation usually states ">= 0 for success", that allows to
> extend their return value later.
> In this particular case, I do not see how an application can accidentally
> send a completely empty packet, and therefore I think forbidding them is
> better.
OK, Let's make it that way then :)


More information about the ffmpeg-devel mailing list