зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d97b525caa
Коммит
da968e2d25
|
@ -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{
|
||||
|
|
Загрузка…
Ссылка в новой задаче