[FFmpeg-devel] [PATCH 8/9] ffprobe: use the codec descriptor if no decoder was found.

Stefano Sabatini stefasab at gmail.com
Tue Apr 22 12:39:08 CEST 2014


On date Thursday 2014-04-17 10:17:46 +0200, Nicolas George encoded:
> 
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  ffprobe.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index 9e39ff7..d3deb18 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -1975,6 +1975,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
>      const char *s;
>      AVRational sar, dar;
>      AVBPrint pbuf;
> +    const AVCodecDescriptor *cd;
>      int ret = 0;
>  
>      av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
> @@ -1992,6 +1993,12 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
>                  if (dec->long_name) print_str    ("codec_long_name", dec->long_name);
>                  else                print_str_opt("codec_long_name", "unknown");
>              }
> +        } else if ((cd = avcodec_descriptor_get(stream->codec->codec_id))) {
> +            print_str_opt("codec_name", cd->name);
> +            if (!do_bitexact) {
> +                print_str_opt("codec_long_name",
> +                              cd->long_name ? cd->long_name : "unknown");
> +            }
>          } else {
>              print_str_opt("codec_name", "unknown");
>              if (!do_bitexact) {

LGTM
-- 
FFmpeg = Fabulous & Free Merciless Pitiless Eretic Gorilla


More information about the ffmpeg-devel mailing list