[FFmpeg-cvslog] avcodec/bsf: mention that av_bsf_send_packet() returning EAGAIN is not an error

James Almer git at videolan.org
Fri May 22 17:17:51 EEST 2020

ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Apr  9 20:02:04 2020 -0300| [1e8ed181e389dbc82b4b29afbee44a63dc76ce10] | committer: James Almer

avcodec/bsf: mention that av_bsf_send_packet() returning EAGAIN is not an error

EAGAIN is returned when input is provided but can't be consumed. The filtering
process is unaffected in this case, and the function will be able to consume
new input after retrieving filtered packets with av_bsf_receive_packet().

Remove the line about empty packets never failing added in
41b05b849f215b03eeb9e3608571ba47de64182a while at it. Even if it's currently
the case, it unnecessarily constrains the API and could be changed in the future
in case it needs to be extended.
The user should always check for errors and never expect a call to never fail.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e8ed181e389dbc82b4b29afbee44a63dc76ce10

 libavcodec/bsf.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h
index 264a10a9b8..7ed51677e8 100644
--- a/libavcodec/bsf.h
+++ b/libavcodec/bsf.h
@@ -182,8 +182,9 @@ int av_bsf_init(AVBSFContext *ctx);
  * sending more empty packets does nothing) and will cause the filter to output
  * any packets it may have buffered internally.
- * @return 0 on success, a negative AVERROR on error. This function never fails if
- * pkt is empty.
+ * @return 0 on success. AVERROR(EAGAIN) if packets need to be retrieved from the
+ * filter (using av_bsf_receive_packet()) before new input can be consumed. Another
+ * negative AVERROR value if an error occurs.
 int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);

More information about the ffmpeg-cvslog mailing list