summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-08 23:33:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-09 00:56:23 +0200
commitf22f873ef013098d61d1e9fc311f5a373fb4f933 (patch)
treee0875bed4d012b022b0a063c2701aa6d1b812b26 /libavcodec
parentbb44f7d5d7e48bd67fa24fbec4a28f9890e444aa (diff)
parent20a5956b8daeee4cb59d6fa00ec809b02c04d7f8 (diff)
Merge commit '20a5956b8daeee4cb59d6fa00ec809b02c04d7f8'
* commit '20a5956b8daeee4cb59d6fa00ec809b02c04d7f8': dump: split audio and video probing on multiple lines Conflicts: libavcodec/utils.c libavformat/dump.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 367e1e580e..69c940b793 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2948,6 +2948,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
const char *profile = NULL;
const AVCodec *p;
int bitrate;
+ int new_line = 0;
AVRational display_aspect_ratio;
if (!buf || buf_size <= 0)
@@ -2985,8 +2986,11 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if (enc->pix_fmt != AV_PIX_FMT_NONE) {
char detail[256] = "(";
const char *colorspace_name;
+
+ av_strlcat(buf, "\n ", buf_size);
+
snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %s",
+ "%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
av_get_pix_fmt_name(enc->pix_fmt));
if (enc->bits_per_raw_sample &&
enc->bits_per_raw_sample <= av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth_minus1)
@@ -3004,10 +3008,14 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
av_strlcatf(buf, buf_size, "%s)", detail);
}
}
+
if (enc->width) {
+ av_strlcat(buf, new_line ? "\n " : ", ", buf_size);
+
snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %dx%d",
+ "%dx%d",
enc->width, enc->height);
+
if (enc->sample_aspect_ratio.num) {
av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
enc->width * enc->sample_aspect_ratio.num,
@@ -3031,11 +3039,11 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
}
break;
case AVMEDIA_TYPE_AUDIO:
+ av_strlcat(buf, "\n ", buf_size);
if (enc->sample_rate) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %d Hz", enc->sample_rate);
+ "%d Hz, ", enc->sample_rate);
}
- av_strlcat(buf, ", ", buf_size);
av_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout);
if (enc->sample_fmt != AV_SAMPLE_FMT_NONE) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),