Bug 1285987: Narrow the workaround added in bug 1276184 to only be effective with webm. r=gerald

Some invalid streams incorrectly tag all frames as keyframes, which cause the frames to be inserted in the wrong order in the trackbuffer.

MozReview-Commit-ID: EZurdiMxmle

--HG--
extra : rebase_source : d739eecb9e5b06aaeefcf044b5735949db86522d
This commit is contained in:
Jean-Yves Avenard 2016-07-13 21:20:50 +10:00
Родитель f3acbf5f85
Коммит 5b39e168bb
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -1625,10 +1625,17 @@ TrackBuffersManager::InsertFrames(TrackBuffer& aSamples,
intersection.Intersection(aIntervals);
if (intersection.Length()) {
if (aSamples[0]->mKeyframe) {
if (aSamples[0]->mKeyframe &&
(mType.LowerCaseEqualsLiteral("video/webm") ||
mType.LowerCaseEqualsLiteral("audio/webm"))) {
// We are starting a new GOP, we do not have to worry about breaking an
// existing current coded frame group. Reset the next insertion index
// so the search for when to start our frames removal can be exhaustive.
// This is a workaround for bug 1276184 and only until either bug 1277733
// or bug 1209386 is fixed.
// With the webm container, we can't always properly determine the
// duration of the last frame, which may cause the last frame of a cluster
// to overlap the following frame.
trackBuffer.mNextInsertionIndex.reset();
}
size_t index =