]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/bsf: Simplify getting codec name
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Fri, 2 Apr 2021 13:21:51 +0000 (15:21 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Tue, 6 Apr 2021 01:20:59 +0000 (03:20 +0200)
All codec ids on BSF whitelists have a codec descriptor, so one can just
use avcodec_get_name() without worrying about the case of what happens
when no codec descriptor is found.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/bsf.c

index 157984bd9a24892b5debdd52405504c907bd7332..543fe87b30ba11f4164c979392afefc020b3e46d 100644 (file)
@@ -160,9 +160,9 @@ int av_bsf_init(AVBSFContext *ctx)
                    "bitstream filter '%s'. Supported codecs are: ",
                    desc ? desc->name : "unknown", ctx->par_in->codec_id, ctx->filter->name);
             for (i = 0; ctx->filter->codec_ids[i] != AV_CODEC_ID_NONE; i++) {
-                desc = avcodec_descriptor_get(ctx->filter->codec_ids[i]);
+                enum AVCodecID codec_id = ctx->filter->codec_ids[i];
                 av_log(ctx, AV_LOG_ERROR, "%s (%d) ",
-                       desc ? desc->name : "unknown", ctx->filter->codec_ids[i]);
+                       avcodec_get_name(codec_id), codec_id);
             }
             av_log(ctx, AV_LOG_ERROR, "\n");
             return AVERROR(EINVAL);