Bug 1313548: P3. Return early of we're not longer waiting for a key. r=gerald

The next run of Update would have cleared the mWaitingForKey flag, may as well do it early.

MozReview-Commit-ID: DXiqSDAxnnz

--HG--
extra : rebase_source : ecdaaab1560d3e4637bbc05689cb9ab91294ae7c
This commit is contained in:
Jean-Yves Avenard 2017-02-24 15:00:39 +01:00
parent e1903d15ee
commit 88913538dd
2 changed files with 2 additions and 1 deletions

View File

@ -1704,6 +1704,7 @@ MediaFormatReader::NotifyWaitingForKey(TrackType aTrack)
}
if (!decoder.mDecodeRequest.Exists()) {
LOGV("WaitingForKey received while no pending decode. Ignoring");
return;
}
decoder.mWaitingForKey = true;
ScheduleUpdate(aTrack);

View File

@ -388,7 +388,7 @@ private:
return false;
}
mWaitingForKey = false;
if (IsWaiting() || mWaitingPromise.IsEmpty()) {
if (IsWaiting() || !HasWaitingPromise()) {
return false;
}
mWaitingPromise.Resolve(mType, __func__);