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

Nicolas George george at nsup.org
Mon Jul 25 18:14:38 EEST 2016


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.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160725/9af2c429/attachment.sig>


More information about the ffmpeg-devel mailing list