mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-24 17:12:34 +02:00
avcodec/bsf: Simplify getting codec name
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>
This commit is contained in:
parent
0f6a3405e8
commit
3e16d1c8a6
@ -160,9 +160,9 @@ int av_bsf_init(AVBSFContext *ctx)
|
|||||||
"bitstream filter '%s'. Supported codecs are: ",
|
"bitstream filter '%s'. Supported codecs are: ",
|
||||||
desc ? desc->name : "unknown", ctx->par_in->codec_id, ctx->filter->name);
|
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++) {
|
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) ",
|
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");
|
av_log(ctx, AV_LOG_ERROR, "\n");
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user