Mercurial > libavformat.hg
changeset 5594:be39b68919ab libavformat
Fix duration calculation in the presence of a single wraping of the timeline.
Fixes issue1714.
author | michael |
---|---|
date | Wed, 27 Jan 2010 19:37:52 +0000 |
parents | cbc342b418f4 |
children | 0980c09b05c1 |
files | utils.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/utils.c Wed Jan 27 19:13:35 2010 +0000 +++ b/utils.c Wed Jan 27 19:37:52 2010 +0000 @@ -1823,6 +1823,8 @@ start_time[pkt->stream_index] != AV_NOPTS_VALUE) { end_time = pkt->pts; duration = end_time - start_time[pkt->stream_index]; + if (duration < 0) + duration += 1LL<<st->pts_wrap_bits; if (duration > 0) { if (st->duration == AV_NOPTS_VALUE || st->duration < duration)