summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2012-04-26 14:14:37 +0300
committerTorsten Jager <t.jager@gmx.de>2012-04-26 14:14:37 +0300
commit946f58f160b0c3004ac49be5dd9c71822387af9e (patch)
treed6c1801d1a29bdb806b10275523988d042879808 /src
parentf75e0c5efc1fcedf4312acedd4e36fd7f5314127 (diff)
downloadxine-lib-946f58f160b0c3004ac49be5dd9c71822387af9e.tar.gz
xine-lib-946f58f160b0c3004ac49be5dd9c71822387af9e.tar.bz2
Fixed demux_qt for the pts < dts case
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_qt.c8
1 files changed, 5 insertions, 3 deletions
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) {