Bug 1251460 - Remove assert introduced in previous commit. r?jya draft
authorBryce Van Dyk <bvandyk@mozilla.com>
Wed, 09 Mar 2016 15:32:49 +1300
changeset 338390 b41bf5b0b94292df1b3045faff8bac04665d6a9e
parent 337569 557dd49781e971b35362f53f7117223f2489766d
child 515795 103154a8db7746be613352685125af7e926f802d
push id12508
push userbvandyk@mozilla.com
push dateWed, 09 Mar 2016 02:38:35 +0000
bugs1251460, 448534
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() {
   // 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.
-  // 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) {