Avoid rollover calculating sample offsets

I considered using Util.scaleLargeTimestamp for this, but
given sample offsets are relative and should always be
small (<<1s), it really shouldn't be necessary.

Issue: #3139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164443795
This commit is contained in:
olly 2017-08-07 03:45:10 -07:00 committed by Oliver Woodman
parent 15bcdf3b71
commit f88149385a

View File

@ -815,7 +815,7 @@ public final class FragmentedMp4Extractor implements Extractor {
// here, because unsigned integers will still be parsed correctly (unless their top bit is
// set, which is never true in practice because sample offsets are always small).
int sampleOffset = trun.readInt();
sampleCompositionTimeOffsetTable[i] = (int) ((sampleOffset * 1000) / timescale);
sampleCompositionTimeOffsetTable[i] = (int) ((sampleOffset * 1000L) / timescale);
} else {
sampleCompositionTimeOffsetTable[i] = 0;
}