summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {