Bug 1183519: P2. Reject promise if decoder couldn't be created. r=me

Follow-up fix.
This commit is contained in:
Jean-Yves Avenard 2015-07-16 15:47:51 +10:00
parent 784efbb8ba
commit 2b61689e5e

View File

@ -976,9 +976,12 @@ MediaFormatReader::DrainDecoder(TrackType aTrack)
if (!decoder.mNeedDraining || decoder.mDraining) {
return;
}
decoder.mNeedDraining = false;
if (!decoder.mDecoder) {
return;
}
decoder.mOutputRequested = true;
decoder.mDecoder->Drain();
decoder.mNeedDraining = false;
decoder.mDraining = true;
LOG("Requesting %s decoder to drain", TrackTypeToStr(aTrack));
}
@ -1045,6 +1048,9 @@ MediaFormatReader::Update(TrackType aTrack)
LOG("Waiting For Data");
decoder.RejectPromise(WAITING_FOR_DATA, __func__);
}
} else if (decoder.mError && !decoder.mDecoder) {
decoder.RejectPromise(DECODE_ERROR, __func__);
return;
}
}