Bug 1261312 - Make sure that audio/video decode task is filed again. r=jwwang

The idea is that we can call Ensure{Audio/Video}DecodeTaskQueued() directly
since the conditions in the DispatchDecodeTasksIfNeeded() have already been
checked.

MozReview-Commit-ID: 9xataQiuSIx

--HG--
extra : transplant_source : %E4t%20%1FV%12%FE%08%9Cx%D7%0A%C3C%B0M%14%80%E4%85
This commit is contained in:
Kaku Kuo 2016-04-07 15:18:17 +08:00
parent 89ac1fb7b9
commit fef7021219

View File

@ -785,7 +785,11 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
->Then(OwnerThread(), __func__,
[self] (MediaData::Type aType) -> void {
self->WaitRequestRef(aType).Complete();
self->DispatchDecodeTasksIfNeeded();
if (aType == MediaData::AUDIO_DATA) {
self->EnsureAudioDecodeTaskQueued();
} else {
self->EnsureVideoDecodeTaskQueued();
}
},
[self] (WaitForDataRejectValue aRejection) -> void {
self->WaitRequestRef(aRejection.mType).Complete();
@ -806,7 +810,11 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType,
}
if (aReason == MediaDecoderReader::CANCELED) {
DispatchDecodeTasksIfNeeded();
if (isAudio) {
EnsureAudioDecodeTaskQueued();
} else {
EnsureVideoDecodeTaskQueued();
}
return;
}