Bug 1298617: [MSE] P2. Attempt to search the exactly matching sample first. r=gerald

MozReview-Commit-ID: AW1T51n6WMl

--HG--
extra : rebase_source : 241a200fdb4f450e8188000aa70ea058aae817b5
This commit is contained in:
Jean-Yves Avenard 2016-08-28 02:38:59 +12:00
Родитель d97b525caa
Коммит da968e2d25
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -2250,6 +2250,18 @@ TrackBuffersManager::FindCurrentPosition(TrackInfo::TrackType aTrack,
auto& trackData = GetTracksData(aTrack);
const TrackBuffer& track = GetTrackBuffer(aTrack);
// Perform an exact search first.
for (uint32_t i = 0; i < track.Length(); i++) {
const RefPtr<MediaRawData>& sample = track[i];
TimeInterval sampleInterval{
TimeUnit::FromMicroseconds(sample->mTimecode),
TimeUnit::FromMicroseconds(sample->mTimecode + sample->mDuration)};
if (sampleInterval.ContainsStrict(trackData.mNextSampleTimecode)) {
return i;
}
}
for (uint32_t i = 0; i < track.Length(); i++) {
const RefPtr<MediaRawData>& sample = track[i];
TimeInterval sampleInterval{