diff options
author | Bryan Huh <bryan@box.com> | 2016-04-12 21:49:27 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-04-14 00:13:15 +0200 |
commit | 949444348b752664243681625f9f1d2c55b6dfaa (patch) | |
tree | 0fe9e81907c551368d2bdc12adf589a41c94c667 | |
parent | 56759f69a6015b3ce6bdf4b7ae441bb44b097e5e (diff) | |
download | ffmpeg-949444348b752664243681625f9f1d2c55b6dfaa.tar.gz |
avformat/dump: Fix sign bug in reported "start" time
Previously, the bug was that if -1 < start_time < 0, the reported
"start" time would lose the negative-sign.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/dump.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c index 3d117f6fdf..d6a3249728 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -559,10 +559,12 @@ void av_dump_format(AVFormatContext *ic, int index, if (ic->start_time != AV_NOPTS_VALUE) { int secs, us; av_log(NULL, AV_LOG_INFO, ", start: "); - secs = ic->start_time / AV_TIME_BASE; + secs = llabs(ic->start_time / AV_TIME_BASE); us = llabs(ic->start_time % AV_TIME_BASE); - av_log(NULL, AV_LOG_INFO, "%d.%06d", - secs, (int) av_rescale(us, 1000000, AV_TIME_BASE)); + av_log(NULL, AV_LOG_INFO, "%s%d.%06d", + ic->start_time >= 0 ? "" : "-", + secs, + (int) av_rescale(us, 1000000, AV_TIME_BASE)); } av_log(NULL, AV_LOG_INFO, ", bitrate: "); if (ic->bit_rate) |