diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-08 23:33:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-09 00:56:23 +0200 |
commit | f22f873ef013098d61d1e9fc311f5a373fb4f933 (patch) | |
tree | e0875bed4d012b022b0a063c2701aa6d1b812b26 /libavformat/dump.c | |
parent | bb44f7d5d7e48bd67fa24fbec4a28f9890e444aa (diff) | |
parent | 20a5956b8daeee4cb59d6fa00ec809b02c04d7f8 (diff) | |
download | ffmpeg-f22f873ef013098d61d1e9fc311f5a373fb4f933.tar.gz |
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 'libavformat/dump.c')
-rw-r--r-- | libavformat/dump.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c index 3a7adbe014..f19bcaebbf 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -118,11 +118,11 @@ static void print_fps(double d, const char *postfix) { uint64_t v = lrintf(d * 100); if (v % 100) - av_log(NULL, AV_LOG_INFO, ", %3.2f %s", d, postfix); + av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix); else if (v % (100 * 1000)) - av_log(NULL, AV_LOG_INFO, ", %1.0f %s", d, postfix); + av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix); else - av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d / 1000, postfix); + av_log(NULL, AV_LOG_INFO, "%1.0fk %s", d / 1000, postfix); } static void dump_metadata(void *ctx, AVDictionary *m, const char *indent) @@ -372,15 +372,21 @@ static void dump_stream_format(AVFormatContext *ic, int i, } if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { - if (st->avg_frame_rate.den && st->avg_frame_rate.num) - print_fps(av_q2d(st->avg_frame_rate), "fps"); -#if FF_API_R_FRAME_RATE - if (st->r_frame_rate.den && st->r_frame_rate.num) - print_fps(av_q2d(st->r_frame_rate), "tbr"); -#endif - if (st->time_base.den && st->time_base.num) - print_fps(1 / av_q2d(st->time_base), "tbn"); - if (st->codec->time_base.den && st->codec->time_base.num) + int fps = st->avg_frame_rate.den && st->avg_frame_rate.num; + int tbr = st->r_frame_rate.den && st->r_frame_rate.num; + int tbn = st->time_base.den && st->time_base.num; + int tbc = st->codec->time_base.den && st->codec->time_base.num; + + if (fps || tbr || tbn || tbc) + av_log(NULL, AV_LOG_INFO, "\n "); + + if (fps) + print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps"); + if (tbr) + print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr"); + if (tbn) + print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn"); + if (tbc) print_fps(1 / av_q2d(st->codec->time_base), "tbc"); } |