[FFmpeg-devel] [PATCH] ffmpeg: add return value check to suppress the build warning.
Bang He
hezhanbang at gmail.com
Thu Nov 23 08:57:48 EET 2017
is it necessary to check AVERROR_EOF?
On Thu, Nov 23, 2017 at 1:14 PM, Jun Zhao <mypopydev at gmail.com> wrote:
>
>
> On 2017/11/23 11:00, Carl Eugen Hoyos wrote:
> > 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
> I didn't know you have submitted a similar patch and Nicolas had some
> comments about the change
> before this mail, will update the warning/error message as the comments.
> Tks.
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
More information about the ffmpeg-devel
mailing list