Loading media/libstagefright/OggExtractor.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -320,22 +320,26 @@ status_t MyVorbisExtractor::seekToTime(int64_t timeUs) { } size_t left = 0; size_t right = mTableOfContents.size() - 1; while (left <= right) { size_t center = left + (right - left) / 2; size_t right_plus_one = mTableOfContents.size(); while (left < right_plus_one) { size_t center = left + (right_plus_one - left) / 2; const TOCEntry &entry = mTableOfContents.itemAt(center); if (timeUs < entry.mTimeUs) { right = center - 1; right_plus_one = center; } else if (timeUs > entry.mTimeUs) { left = center + 1; } else { left = right = center; left = center; break; } } if (left == mTableOfContents.size()) { --left; } const TOCEntry &entry = mTableOfContents.itemAt(left); ALOGV("seeking to entry %zu / %zu at offset %lld", Loading media/libstagefright/SampleTable.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -525,14 +525,14 @@ status_t SampleTable::findSampleAtTime( buildSampleEntriesTable(); uint32_t left = 0; uint32_t right = mNumSampleSizes - 1; while (left <= right) { uint32_t center = left + (right - left) / 2; uint32_t right_plus_one = mNumSampleSizes; while (left < right_plus_one) { uint32_t center = left + (right_plus_one - left) / 2; uint64_t centerTime = getSampleTime(center, scale_num, scale_den); if (req_time < centerTime) { right = center - 1; right_plus_one = center; } else if (req_time > centerTime) { left = center + 1; } else { Loading Loading @@ -607,13 +607,13 @@ status_t SampleTable::findSyncSampleNear( } uint32_t left = 0; uint32_t right = mNumSyncSamples - 1; while (left <= right) { uint32_t center = left + (right - left) / 2; uint32_t right_plus_one = mNumSyncSamples; while (left < right_plus_one) { uint32_t center = left + (right_plus_one - left) / 2; uint32_t x = mSyncSamples[center]; if (start_sample_index < x) { right = center - 1; right_plus_one = center; } else if (start_sample_index > x) { left = center + 1; } else { Loading Loading
media/libstagefright/OggExtractor.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -320,22 +320,26 @@ status_t MyVorbisExtractor::seekToTime(int64_t timeUs) { } size_t left = 0; size_t right = mTableOfContents.size() - 1; while (left <= right) { size_t center = left + (right - left) / 2; size_t right_plus_one = mTableOfContents.size(); while (left < right_plus_one) { size_t center = left + (right_plus_one - left) / 2; const TOCEntry &entry = mTableOfContents.itemAt(center); if (timeUs < entry.mTimeUs) { right = center - 1; right_plus_one = center; } else if (timeUs > entry.mTimeUs) { left = center + 1; } else { left = right = center; left = center; break; } } if (left == mTableOfContents.size()) { --left; } const TOCEntry &entry = mTableOfContents.itemAt(left); ALOGV("seeking to entry %zu / %zu at offset %lld", Loading
media/libstagefright/SampleTable.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -525,14 +525,14 @@ status_t SampleTable::findSampleAtTime( buildSampleEntriesTable(); uint32_t left = 0; uint32_t right = mNumSampleSizes - 1; while (left <= right) { uint32_t center = left + (right - left) / 2; uint32_t right_plus_one = mNumSampleSizes; while (left < right_plus_one) { uint32_t center = left + (right_plus_one - left) / 2; uint64_t centerTime = getSampleTime(center, scale_num, scale_den); if (req_time < centerTime) { right = center - 1; right_plus_one = center; } else if (req_time > centerTime) { left = center + 1; } else { Loading Loading @@ -607,13 +607,13 @@ status_t SampleTable::findSyncSampleNear( } uint32_t left = 0; uint32_t right = mNumSyncSamples - 1; while (left <= right) { uint32_t center = left + (right - left) / 2; uint32_t right_plus_one = mNumSyncSamples; while (left < right_plus_one) { uint32_t center = left + (right_plus_one - left) / 2; uint32_t x = mSyncSamples[center]; if (start_sample_index < x) { right = center - 1; right_plus_one = center; } else if (start_sample_index > x) { left = center + 1; } else { Loading