Bug 1382557 - the duration should be finite when we can get one from the metadata. r=cpearce

This fixes the case where ChannelMediaResource::OnStartRequest() calls
mCallback->SetInfinite(true) to report an infinite duration, yet later
we get another duratoin from the metadata.

http://searchfox.org/mozilla-central/rev/8a61c71153a79cda2e1ae7d477564347c607cc5f/dom/media/MediaDecoder.cpp#1179-1185
Note IsInfinite() is checked before other duration sources. We need to call
SetInfinite(false) on the MediaDecoder so we can get the correct duration.

MozReview-Commit-ID: 3BlFNJzlgXo

--HG--
extra : rebase_source : 073b65cbc21f280638054b80f0cc9913a9128a18
This commit is contained in:
JW Wang 2017-07-25 14:34:59 +08:00
Родитель a9bab5de7c
Коммит f507668c63
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -763,6 +763,11 @@ MediaDecoder::MetadataLoaded(UniquePtr<MediaInfo> aInfo,
Invalidate();
EnsureTelemetryReported();
// The duration is no longer infinite when we get one from the metadata.
if (mInfo->mMetadataDuration && IsInfinite()) {
SetInfinite(false);
}
}
void