[FFmpeg-devel] [PATCH] ffprobe: downgrade log level for non fatal errors in open_input_file()

Clément Bœsch u at pkh.me
Tue Sep 17 13:51:15 CEST 2013


On Mon, Sep 16, 2013 at 07:22:25PM +0200, Stefano Sabatini wrote:
> Since the errors are not fatal, it is less confusing not to show them in
> yellow.
> 
> Arbitrarily fixes trac ticket #2419.
> ---
>  ffprobe.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index 4ad88a4..ca96742 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -2012,18 +2012,18 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
>          AVCodec *codec;
>  
>          if (stream->codec->codec_id == AV_CODEC_ID_PROBE) {
> -            av_log(NULL, AV_LOG_ERROR,
> +            av_log(NULL, AV_LOG_WARNING,
>                     "Failed to probe codec for input stream %d\n",
>                      stream->index);
>          } else if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
> -            av_log(NULL, AV_LOG_ERROR,
> +            av_log(NULL, AV_LOG_WARNING,
>                      "Unsupported codec with id %d for input stream %d\n",
>                      stream->codec->codec_id, stream->index);
>          } else {
>              AVDictionary *opts = filter_codec_opts(codec_opts, stream->codec->codec_id,
>                                                     fmt_ctx, stream, codec);
>              if (avcodec_open2(stream->codec, codec, &opts) < 0) {

> -                av_log(NULL, AV_LOG_ERROR, "Error while opening codec for input stream %d\n",
> +                av_log(NULL, AV_LOG_WARNING, "Error while opening codec for input stream %d\n",

nit: remove the "Error" from the message; something like "Unable to
open..."

>                         stream->index);
>              }
>              if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {

Should be OK

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130917/d77da7b7/attachment.asc>


More information about the ffmpeg-devel mailing list