aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-01-01 14:58:05 +0100
committerAnton Khirnov <anton@khirnov.net>2015-12-12 21:24:29 +0100
commitcea1eef25c3310a68dd327eb74aae14ad3c2ddef (patch)
tree1a16527ddc48dece02eb1cebeb122cf0302a7450
parent2c6811397bdf13d43ca206e48d6d6da9c2cd47c6 (diff)
downloadffmpeg-cea1eef25c3310a68dd327eb74aae14ad3c2ddef.tar.gz
lavc: get the profile name through the codec descriptor in avcodec_string()
-rw-r--r--libavcodec/utils.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 78ce0dc609..29ba85fd21 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1749,25 +1749,15 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
{
const char *codec_name;
const char *profile = NULL;
- const AVCodec *p;
char buf1[32];
int bitrate;
int new_line = 0;
AVRational display_aspect_ratio;
const AVCodecDescriptor *desc = avcodec_descriptor_get(enc->codec_id);
- if (enc->codec)
- p = enc->codec;
- else if (encode)
- p = avcodec_find_encoder(enc->codec_id);
- else
- p = avcodec_find_decoder(enc->codec_id);
-
- if (p)
- profile = av_get_profile_name(p, enc->profile);
-
if (desc) {
codec_name = desc->name;
+ profile = avcodec_profile_name(enc->codec_id, enc->profile);
} else if (enc->codec_id == AV_CODEC_ID_MPEG2TS) {
/* fake mpeg2 transport stream codec (currently not
* registered) */