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.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -160,9 +160,9 @@ int av_bsf_init(AVBSFContext *ctx) · 159 unmodified lines | |||
| 160 | "bitstream filter '%s'. Supported codecs are: ", | 160 | "bitstream filter '%s'. Supported codecs are: ", |
| 161 | desc ? desc->name : "unknown", ctx->par_in->codec_id, ctx->filter->name); | 161 | desc ? desc->name : "unknown", ctx->par_in->codec_id, ctx->filter->name); |
| 162 | for (i = 0; ctx->filter->codec_ids[i] != AV_CODEC_ID_NONE; i++) { | 162 | for (i = 0; ctx->filter->codec_ids[i] != AV_CODEC_ID_NONE; i++) { |
| 163 | desc = avcodec_descriptor_get(ctx->filter->codec_ids[i]); | 163 | enum AVCodecID codec_id = ctx->filter->codec_ids[i]; |
| 164 | av_log(ctx, AV_LOG_ERROR, "%s (%d) ", | 164 | av_log(ctx, AV_LOG_ERROR, "%s (%d) ", |
| 165 | desc ? desc->name : "unknown", ctx->filter->codec_ids[i]); | 165 | avcodec_get_name(codec_id), codec_id); |
| 166 | } | 166 | } |
| 167 | av_log(ctx, AV_LOG_ERROR, "\n"); | 167 | av_log(ctx, AV_LOG_ERROR, "\n"); |
| 168 | return AVERROR(EINVAL); | 168 | return AVERROR(EINVAL); |