Bug 1251460 - Remove assert introduced in previous commit. r?jya
The previous changes introduce an assert in UpdateBufferedWithPromise which
assumes that after updating there will always be some buffered interval.
However, it appears possible to very quickly shutdown the underlying decoder and
have it purge any buffered data and to race the UpdateBufferedWithPromise check.
The test_bug448534.html test highlighted this.
I think it's valid to have an empty buffered range in the case where a shutdown
has happened, and I cannot find an elegant way to reword the assert, as such I'm
removing it.
MozReview-Commit-ID: 4GGxvScKxY7
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1616,21 +1616,16 @@ RefPtr<MediaDecoderReader::BufferedUpdat
MediaFormatReader::UpdateBufferedWithPromise() {
MOZ_ASSERT(OnTaskQueue());
// Call NotifyDataArrive to force a recalculation of the buffered
// ranges. UpdateBuffered alone will not force a recalculation, so we
// use NotifyDataArrived which sets flags to force this recalculation.
// See MediaFormatReader::UpdateReceivedNewData for an example of where
// the new data flag is used.
NotifyDataArrived();
- // Data must be buffered at this stage as this is called by the
- // MediaDecoderStateMachine after decoding the first frame. This
- // assertion should not be moved to the MDSM level as not all readers
- // implement populating mBuffered.
- MOZ_ASSERT(mBuffered.Ref().Length() > 0);
return BufferedUpdatePromise::CreateAndResolve(true, __func__);
}
void MediaFormatReader::ReleaseMediaResources()
{
// Before freeing a video codec, all video buffers needed to be released
// even from graphics pipeline.
if (mVideoFrameContainer) {