Bug 1188233: Ensure drainComplete flag is set upon failure to create decoder. r=cpearce

This commit is contained in:
Jean-Yves Avenard 2015-07-28 14:09:43 +10:00
parent 7904f7befa
commit b3b4eca437

View File

@ -984,11 +984,11 @@ MediaFormatReader::DrainDecoder(TrackType aTrack)
return;
}
decoder.mNeedDraining = false;
if (!decoder.mDecoder) {
return;
}
// mOutputRequest must be set, otherwise NotifyDrainComplete()
// may reject the drain if a Flush recently occurred.
decoder.mOutputRequested = true;
if (decoder.mNumSamplesInput == decoder.mNumSamplesOutput) {
if (!decoder.mDecoder ||
decoder.mNumSamplesInput == decoder.mNumSamplesOutput) {
// No frames to drain.
NotifyDrainComplete(aTrack);
return;