summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-10 22:09:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-11 11:22:27 +0100
commit23849339855875b737aee94813b31ddde2e40f9a (patch)
treec2834ee83ff9502b3ad350b8bbe458c3ee798e1b /ffmpeg.c
parent08509c8f86626815a3e9e68d600d1aacbb8df4bf (diff)
ffmpeg: Print negative times like "-00:05:01.22" instead of "00:-5:-1.-22"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index fd45afb837..becd5dfc33 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1528,8 +1528,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
nb_frames_drop += ost->last_droped;
}
- secs = pts / AV_TIME_BASE;
- us = pts % AV_TIME_BASE;
+ secs = FFABS(pts) / AV_TIME_BASE;
+ us = FFABS(pts) % AV_TIME_BASE;
mins = secs / 60;
secs %= 60;
hours = mins / 60;
@@ -1541,6 +1541,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
"size=N/A time=");
else snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"size=%8.0fkB time=", total_size / 1024.0);
+ if (pts < 0)
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "-");
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"%02d:%02d:%02d.%02d ", hours, mins, secs,
(100 * us) / AV_TIME_BASE);