Bug 1482116 - Only schedule update when a track exists. r=bryce

Add assertion to more easily catch the problem

Differential Revision: https://phabricator.services.mozilla.com/D3018

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2018-08-09 16:24:33 +00:00
Родитель 29c135b563
Коммит c80c137b83
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -1474,8 +1474,12 @@ MediaFormatReader::ResolveSetCDMPromiseIfDone(TrackType aTrack)
if (mSetCDMForTracks.isEmpty()) {
LOGV("%s : Done ", __func__);
mSetCDMPromise.Resolve(/* aIgnored = */ true, __func__);
ScheduleUpdate(TrackInfo::kAudioTrack);
ScheduleUpdate(TrackInfo::kVideoTrack);
if (HasAudio()) {
ScheduleUpdate(TrackInfo::kAudioTrack);
}
if (HasVideo()) {
ScheduleUpdate(TrackInfo::kVideoTrack);
}
return true;
}
LOGV("%s : %s track is ready.", __func__, TrackTypeToStr(aTrack));
@ -2221,6 +2225,9 @@ MediaFormatReader::ScheduleUpdate(TrackType aTrack)
return;
}
auto& decoder = GetDecoderData(aTrack);
MOZ_RELEASE_ASSERT(decoder.GetCurrentInfo(),
"Can only schedule update when track exists");
if (decoder.mUpdateScheduled) {
return;
}