Commit 0b2197fe authored by michael's avatar michael

Fix duration calculation in the presence of a single wraping of the timeline.

Fixes issue1714.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21485 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0a3f36ae
...@@ -1823,6 +1823,8 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset ...@@ -1823,6 +1823,8 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset
start_time[pkt->stream_index] != AV_NOPTS_VALUE) { start_time[pkt->stream_index] != AV_NOPTS_VALUE) {
end_time = pkt->pts; end_time = pkt->pts;
duration = end_time - start_time[pkt->stream_index]; duration = end_time - start_time[pkt->stream_index];
if (duration < 0)
duration += 1LL<<st->pts_wrap_bits;
if (duration > 0) { if (duration > 0) {
if (st->duration == AV_NOPTS_VALUE || if (st->duration == AV_NOPTS_VALUE ||
st->duration < duration) st->duration < duration)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment