diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-31 18:48:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-31 19:12:47 +0100 |
commit | 6992b0bfc2f5276918b45a6e42c8c6c56b35b994 (patch) | |
tree | 00485f79b518d98d4fd640e8b04668b446e68614 /libavformat/utils.c | |
parent | 3a34ac654174c738aace225796ff05ab083b771a (diff) | |
download | ffmpeg-6992b0bfc2f5276918b45a6e42c8c6c56b35b994.tar.gz |
utils: fix rounding of micro seconds
Found-by: Johan Wessfeldt <johan.wessfeldt@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index fb5742b815..3171b21ea3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3354,8 +3354,9 @@ void av_dump_format(AVFormatContext *ic, av_log(NULL, AV_LOG_INFO, " Duration: "); if (ic->duration != AV_NOPTS_VALUE) { int hours, mins, secs, us; - secs = ic->duration / AV_TIME_BASE; - us = ic->duration % AV_TIME_BASE; + int64_t duration = ic->duration + 5000; + secs = duration / AV_TIME_BASE; + us = duration % AV_TIME_BASE; mins = secs / 60; secs %= 60; hours = mins / 60; |