summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2011-01-08 09:23:25 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2011-01-08 09:23:25 +0000
commit2a81f4bde50f731074c1be7368128de49f78925a (patch)
tree9d2c5e83342b142508910615d8970d8f8d275328 /libavcodec/utils.c
parent82dadb90a71455d17e7f38afbd3ae8a840bc9679 (diff)
Show profile in avcodec_string().
Patch by Anssi Hannula, anssi d hannula a iki d fi Originally committed as revision 26264 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0295147481..8cc92994dc 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -871,6 +871,7 @@ size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_ta
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
{
const char *codec_name;
+ const char *profile = NULL;
AVCodec *p;
char buf1[32];
int bitrate;
@@ -883,6 +884,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if (p) {
codec_name = p->name;
+ profile = av_get_profile_name(p, enc->profile);
} else if (enc->codec_id == CODEC_ID_MPEG2TS) {
/* fake mpeg2 transport stream codec (currently not
registered) */
@@ -902,6 +904,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf, buf_size,
"Video: %s%s",
codec_name, enc->mb_decision ? " (hq)" : "");
+ if (profile)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ " (%s)", profile);
if (enc->pix_fmt != PIX_FMT_NONE) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s",
@@ -937,6 +942,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf, buf_size,
"Audio: %s",
codec_name);
+ if (profile)
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ " (%s)", profile);
if (enc->sample_rate) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %d Hz", enc->sample_rate);