[FFmpeg-cvslog] utils: fix rounding of micro seconds
Michael Niedermayer
git at videolan.org
Wed Oct 31 19:17:12 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct 31 18:48:58 2012 +0100| [6992b0bfc2f5276918b45a6e42c8c6c56b35b994] | committer: Michael Niedermayer
utils: fix rounding of micro seconds
Found-by: Johan Wessfeldt <johan.wessfeldt at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6992b0bfc2f5276918b45a6e42c8c6c56b35b994
---
libavformat/utils.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index fb5742b..3171b21 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;
More information about the ffmpeg-cvslog
mailing list