author | Jean-Yves Avenard <jyavenard@mozilla.com> |
Tue, 19 Sep 2017 09:11:26 +0200 | |
changeset 381651 | a766b936e0b14bc59303f39943579156e5a2f4d6 |
parent 381650 | 5bce0c884d7af72c4c3b9a463b17fceee7a2a8ab |
child 381652 | ea4c53366f8dbedbe1c8d4bf717c6cfc9c09e591 |
push id | 32535 |
push user | kwierso@gmail.com |
push date | Tue, 19 Sep 2017 21:06:08 +0000 |
treeherder | mozilla-central@c0d1f9eb2a40 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kikuo |
bugs | 1389304 |
milestone | 57.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/media/libstagefright/binding/MoofParser.cpp +++ b/media/libstagefright/binding/MoofParser.cpp @@ -671,35 +671,37 @@ Moof::ParseTrun(Box& aBox, Tfhd& aTfhd, uint32_t sampleFlags = flags & 0x400 ? reader->ReadU32() : i ? aTfhd.mDefaultSampleFlags : firstSampleFlags; int32_t ctsOffset = 0; if (flags & 0x800) { ctsOffset = reader->Read32(); } - Sample sample; - sample.mByteRange = MediaByteRange(offset, offset + sampleSize); - offset += sampleSize; + if (sampleSize) { + Sample sample; + sample.mByteRange = MediaByteRange(offset, offset + sampleSize); + offset += sampleSize; - sample.mDecodeTime = - aMdhd.ToMicroseconds((int64_t)decodeTime - aEdts.mMediaStart) + aMvhd.ToMicroseconds(aEdts.mEmptyOffset); - sample.mCompositionRange = Interval<Microseconds>( - aMdhd.ToMicroseconds((int64_t)decodeTime + ctsOffset - aEdts.mMediaStart) + aMvhd.ToMicroseconds(aEdts.mEmptyOffset), - aMdhd.ToMicroseconds((int64_t)decodeTime + ctsOffset + sampleDuration - aEdts.mMediaStart) + aMvhd.ToMicroseconds(aEdts.mEmptyOffset)); + sample.mDecodeTime = + aMdhd.ToMicroseconds((int64_t)decodeTime - aEdts.mMediaStart) + aMvhd.ToMicroseconds(aEdts.mEmptyOffset); + sample.mCompositionRange = Interval<Microseconds>( + aMdhd.ToMicroseconds((int64_t)decodeTime + ctsOffset - aEdts.mMediaStart) + aMvhd.ToMicroseconds(aEdts.mEmptyOffset), + aMdhd.ToMicroseconds((int64_t)decodeTime + ctsOffset + sampleDuration - aEdts.mMediaStart) + aMvhd.ToMicroseconds(aEdts.mEmptyOffset)); + + // Sometimes audio streams don't properly mark their samples as keyframes, + // because every audio sample is a keyframe. + sample.mSync = !(sampleFlags & 0x1010000) || aIsAudio; + + // FIXME: Make this infallible after bug 968520 is done. + MOZ_ALWAYS_TRUE(mIndex.AppendElement(sample, fallible)); + + mMdatRange = mMdatRange.Span(sample.mByteRange); + } decodeTime += sampleDuration; - - // Sometimes audio streams don't properly mark their samples as keyframes, - // because every audio sample is a keyframe. - sample.mSync = !(sampleFlags & 0x1010000) || aIsAudio; - - // FIXME: Make this infallible after bug 968520 is done. - MOZ_ALWAYS_TRUE(mIndex.AppendElement(sample, fallible)); - - mMdatRange = mMdatRange.Span(sample.mByteRange); } mMaxRoundingError += aMdhd.ToMicroseconds(sampleCount); *aDecodeTime = decodeTime; return true; }