[FFmpeg-devel] [PATCH] lavc: Mark functions where ignoring returned error code is always wrong

Marton Balint cus at passwd.hu
Fri Sep 15 00:54:29 EEST 2017


On Thu, 14 Sep 2017, Mark Thompson wrote:

> ---
> There are more around, but this marks all of the obvious ones in avcodec.h.
>

[...]

> +av_warn_unused_result
> int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);

>  */
> +av_warn_unused_result
> int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame);

I am not sure about these, these can only fail with ENOMEM if the user 
always gets all available frames/packets, but even if there is no memory, 
no state will be changed, the ownership of the packet/frame will remain 
with the caller, no null pointer will be returned, so if ignoring 
these is what the user wants, then so be it, no "undefined" behaviour will 
occur and we are not breaking the API contract by continuing like nothing 
happened.

Regards,
Marton


More information about the ffmpeg-devel mailing list