aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-09-26 14:37:40 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-08 18:17:49 +0100
commit20a5956b8daeee4cb59d6fa00ec809b02c04d7f8 (patch)
treebf691a44ac7794a723ae2157778ad7defd866a85 /libavcodec/utils.c
parent5a419b2dd1881889d436f55741fd3ff3f9f436c4 (diff)
downloadffmpeg-20a5956b8daeee4cb59d6fa00ec809b02c04d7f8.tar.gz
dump: split audio and video probing on multiple lines
Also always report pixel format.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8ecf358b61..4d097d45e8 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1887,6 +1887,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
const AVCodec *p;
char buf1[32];
int bitrate;
+ int new_line = 0;
AVRational display_aspect_ratio;
if (enc->codec)
@@ -1919,15 +1920,19 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if (profile)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
" (%s)", profile);
- if (enc->pix_fmt != AV_PIX_FMT_NONE) {
- snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %s",
+
+ av_strlcat(buf, "\n ", buf_size);
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ "%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :
av_get_pix_fmt_name(enc->pix_fmt));
- }
+
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,
@@ -1957,11 +1962,11 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if (profile)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
" (%s)", profile);
+ 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),