From 946f58f160b0c3004ac49be5dd9c71822387af9e Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Thu, 26 Apr 2012 14:14:37 +0300 Subject: Fixed demux_qt for the pts < dts case --- src/demuxers/demux_qt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index e0455678b..7ef850028 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -2020,9 +2020,11 @@ static qt_error build_frame_table(qt_trak *trak, /* offset pts for reordered video */ if (ptsoffs_index < trak->timeoffs_to_sample_count) { - trak->frames[frame_counter].ptsoffs = 90000 * - trak->timeoffs_to_sample_table[ptsoffs_index].duration / - trak->timescale; + /* TJ. this is 32 bit signed. All casts necessary for my gcc 4.5.0 */ + int i = trak->timeoffs_to_sample_table[ptsoffs_index].duration; + if ((sizeof (int) > 4) && (i & 0x80000000)) + i |= ~0xffffffffL; + trak->frames[frame_counter].ptsoffs = (int)90000 * i / (int)trak->timescale; ptsoffs_index_countdown--; /* time to refresh countdown? */ if (!ptsoffs_index_countdown) { -- cgit v1.2.3