Bug 1188238: [MSE] P1. Don't use Interval::Intersect to find the first frame of an interval. r=gerald

With H264, often the first frame of a media segment has no duration ; as such the time interval it represents is empty and will never intersect with anything.
This commit is contained in:
Jean-Yves Avenard 2015-09-12 20:49:49 +10:00
parent 4544540d27
commit 3e080a3d22

View File

@ -1598,10 +1598,8 @@ TrackBuffersManager::CheckNextInsertionIndex(TrackData& aTrackData,
}
for (uint32_t i = 0; i < data.Length(); i++) {
const nsRefPtr<MediaRawData>& sample = data[i];
TimeInterval sampleInterval{
TimeUnit::FromMicroseconds(sample->mTime),
TimeUnit::FromMicroseconds(sample->GetEndTime())};
if (target.Intersects(sampleInterval)) {
if (sample->mTime >= target.mStart.ToMicroseconds() ||
sample->GetEndTime() > target.mStart.ToMicroseconds()) {
aTrackData.mNextInsertionIndex = Some(size_t(i));
return;
}