Bug 1274933: Reject data promise when EOS is encountered following waiting for data. r=gerald

MozReview-Commit-ID: 1hKplz5wFnJ

--HG--
extra : rebase_source : 301821b51146e5cc7273f86b53b16c1e6ef6ca08
This commit is contained in:
Jean-Yves Avenard 2016-05-24 19:58:36 +10:00
parent 0304c38349
commit 708b1db5db

View File

@ -1205,6 +1205,15 @@ MediaFormatReader::Update(TrackType aTrack)
LOGV("Nothing more to do");
return;
}
} else if (decoder.mDemuxEOS && !decoder.mNeedDraining &&
!decoder.mDraining && !decoder.mDrainComplete &&
decoder.mQueuedSamples.IsEmpty()) {
// It is possible to transition from WAITING_FOR_DATA directly to EOS
// state during the internal seek; in which case no draining would occur.
// There is no more samples left to be decoded and we are already in
// EOS state. We can immediately reject the data promise.
LOG("Rejecting %s promise: EOS", TrackTypeToStr(aTrack));
decoder.RejectPromise(END_OF_STREAM, __func__);
}
}