[FFmpeg-devel] [PATCH]ffmpeg: Improve warnings if av_buffersrc_add_frame*() fail

Nicolas George george at nsup.org
Thu Nov 23 17:32:51 EET 2017


Carl Eugen Hoyos (2017-11-23):
> Hi!
> 
> Attached patch implements more verbose warnings as suggested by Nicolas.
> 
> Please comment, Carl Eugen

> From 5ec3b8bdb776d9c14127017cd9e3077503be2bea Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
> Date: Thu, 23 Nov 2017 12:05:51 +0100
> Subject: [PATCH] ffmpeg: Improve warnings if av_buffersrc_add_frame*() fail.
> 
> Suggested-by: Nicolas
> ---
>  fftools/ffmpeg.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 0c16e75..3ce8833 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -229,7 +229,8 @@ static void sub2video_push_ref(InputStream *ist, int64_t pts)
>                                             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",
> +            av_log(ist->filters[i]->filter, AV_LOG_WARNING,
> +                   "Failed to add a subtitle video frame to the buffer source: %s\n",

This part LGTM. But "buffer source" is not meant for end-users. "... to
the filter graph"?

>                     av_err2str(ret));
>      }
>  }
> @@ -307,7 +308,9 @@ static void sub2video_flush(InputStream *ist)
>      for (i = 0; i < ist->nb_filters; i++) {
>          ret = av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
>          if (ret != AVERROR_EOF && ret < 0)

> -            av_log(NULL, AV_LOG_WARNING, "Flush the frame error.\n");
> +            av_log(ist->filters[i]->filter, AV_LOG_WARNING,
> +                   "Failed to add a subtitle video frame to the buffer source: %s\n",
> +                   av_err2str(ret));

This one looks wrong: there is no frame added, the error message you
remove is more accurate.

>      }
>  }
>  

Sorry to have been unresponsive on this issues the last few days.

Regards,

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


More information about the ffmpeg-devel mailing list