[FFmpeg-devel] [PATCH] ffmpeg: add return value check to suppress the build warning.

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Nov 23 05:00:13 EET 2017


2017-11-20 10:07 GMT+01:00 刘歧 <lq at chinaffmpeg.org>:

> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index babd85f7bc..0c16e75ab0 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -220,13 +220,18 @@ static void sub2video_push_ref(InputStream *ist, int64_t pts)
>  {
>      AVFrame *frame = ist->sub2video.frame;
>      int i;
> +    int ret;
>
>      av_assert1(frame->data[0]);
>      ist->sub2video.last_pts = frame->pts = pts;
> -    for (i = 0; i < ist->nb_filters; i++)
> -        av_buffersrc_add_frame_flags(ist->filters[i]->filter, frame,
> -                                     AV_BUFFERSRC_FLAG_KEEP_REF |
> -                                     AV_BUFFERSRC_FLAG_PUSH);
> +    for (i = 0; i < ist->nb_filters; i++) {
> +        ret = av_buffersrc_add_frame_flags(ist->filters[i]->filter, frame,
> +                                           AV_BUFFERSRC_FLAG_KEEP_REF |
> +                                           AV_BUFFERSRC_FLAG_PUSH);
> +        if (ret != AVERROR_EOF && ret < 0)
> +            av_log(NULL, AV_LOG_WARNING, "Error while add the frame to buffer source(%s).\n",

Nicolas had a comment about this change:
http://ffmpeg.org/pipermail/ffmpeg-devel/2017-February/207015.html

Carl Eugen


More information about the ffmpeg-devel mailing list