[FFmpeg-devel] [PATCH]Only show "Codec is not in the full list" warning for id != 0

Nicolas George nicolas.george at normalesup.org
Sun Aug 19 12:29:58 CEST 2012

Le tridi 3 fructidor, an CCXX, Carl Eugen Hoyos a écrit :
> Hi!
> Attached patch silences one FFmpeg warning when reading unknown codecs.
> Please comment, Carl Eugen

> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index a96b52d..719a00b 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1854,6 +1854,7 @@ const char *avcodec_get_name(enum AVCodecID id)
>      cd = avcodec_descriptor_get(id);
>      if (cd)
>          return cd->name;
> +    if (id)
>      av_log(NULL, AV_LOG_WARNING, "Codec 0x%x is not in the full list.\n", id);
>      codec = avcodec_find_decoder(id);
>      if (codec)

Maybe it would make sense to distinguish between CODEC_ID_NONE and real
codec ids that are not in the list. IIRC, the previous implementation would
return "none" for CODEC_ID_NONE, so I guess:

    if (id == AV_CODEC_ID_NONE)
	return "none";

would be more backward compatible. Better wording is an option, but I have
no precise idea.

Thanks for spotting it, though.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120819/e9c53493/attachment.asc>

More information about the ffmpeg-devel mailing list