Skip to content
Snippets Groups Projects
Commit 94944434 authored by Bryan Huh's avatar Bryan Huh Committed by Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 56759f69
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment