зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1313548: P1. Always resolve waiting promise, when clearing waitforkey. r=gerald
MozReview-Commit-ID: 6xu8Rcn9WMO --HG-- extra : rebase_source : 54f99f2d4fc6370ee64a6e3dc0bec69f5edc9085
This commit is contained in:
Родитель
f6dc8cf256
Коммит
2a41ec036c
|
@ -2279,13 +2279,9 @@ MediaFormatReader::Update(TrackType aTrack)
|
|||
return;
|
||||
}
|
||||
|
||||
if (decoder.mWaitingForKey) {
|
||||
decoder.mWaitingForKey = false;
|
||||
if (decoder.HasWaitingPromise() && !decoder.IsWaiting()) {
|
||||
LOGV("No longer waiting for key. Resolving waiting promise");
|
||||
decoder.mWaitingPromise.Resolve(decoder.mType, __func__);
|
||||
return;
|
||||
}
|
||||
if (decoder.CancelWaitingForKey()) {
|
||||
LOGV("No longer waiting for key. Resolving waiting promise");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!needInput) {
|
||||
|
|
|
@ -349,6 +349,7 @@ private:
|
|||
mDecodeRequest.DisconnectIfExists();
|
||||
mDrainRequest.DisconnectIfExists();
|
||||
mDrainState = DrainState::None;
|
||||
CancelWaitingForKey();
|
||||
mOutput.Clear();
|
||||
mNumSamplesInput = 0;
|
||||
mNumSamplesOutput = 0;
|
||||
|
@ -381,6 +382,19 @@ private:
|
|||
mFlushed = true;
|
||||
}
|
||||
|
||||
bool CancelWaitingForKey()
|
||||
{
|
||||
if (!mWaitingForKey) {
|
||||
return false;
|
||||
}
|
||||
mWaitingForKey = false;
|
||||
if (IsWaiting() || mWaitingPromise.IsEmpty()) {
|
||||
return false;
|
||||
}
|
||||
mWaitingPromise.Resolve(mType, __func__);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Reset the state of the DecoderData, clearing all queued frames
|
||||
// (pending demuxed and decoded).
|
||||
// The track demuxer is *not* reset.
|
||||
|
@ -389,11 +403,11 @@ private:
|
|||
MOZ_ASSERT(mOwner->OnTaskQueue());
|
||||
mDemuxEOS = false;
|
||||
mWaitingForData = false;
|
||||
mWaitingForKey = false;
|
||||
mQueuedSamples.Clear();
|
||||
mDecodeRequest.DisconnectIfExists();
|
||||
mDrainRequest.DisconnectIfExists();
|
||||
mDrainState = DrainState::None;
|
||||
CancelWaitingForKey();
|
||||
mTimeThreshold.reset();
|
||||
mLastSampleTime.reset();
|
||||
mOutput.Clear();
|
||||
|
|
Загрузка…
Ссылка в новой задаче