Bug 1189992: Don't assume the last chunk always contains the sample we're looking for. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 16 Sep 2015 11:54:56 +1000
changeset 295340 61a6a8dcefd364bc7a069198d065abf78ca0307d
parent 295339 1bc5e8663f6404c6e7d3e5624267c7e09101b4ca
child 295341 67b5ece6a4c99f5ca2fec2d4d4ef490a76a95585
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1189992
milestone43.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
Bug 1189992: Don't assume the last chunk always contains the sample we're looking for. r=gerald If a chunk contains no samples it should be skipped and continue the search (and maybe hit EOS)
media/libstagefright/frameworks/av/media/libstagefright/SampleIterator.cpp
--- a/media/libstagefright/frameworks/av/media/libstagefright/SampleIterator.cpp
+++ b/media/libstagefright/frameworks/av/media/libstagefright/SampleIterator.cpp
@@ -172,17 +172,17 @@ status_t SampleIterator::findChunkRange(
         mChunkDesc = entry->chunkDesc;
 
         if (mSampleToChunkIndex + 1 < mTable->mNumSampleToChunkOffsets) {
             mStopChunk = entry[1].startChunk;
 
             mStopChunkSampleIndex =
                 mFirstChunkSampleIndex
                     + (mStopChunk - mFirstChunk) * mSamplesPerChunk;
-        } else {
+        } else if (mSamplesPerChunk) {
             mStopChunk = 0xffffffff;
             mStopChunkSampleIndex = 0xffffffff;
         }
 
         ++mSampleToChunkIndex;
     }
 
     return OK;