diff --git a/content/media/mediasource/SourceBuffer.cpp b/content/media/mediasource/SourceBuffer.cpp index e6570b772a0d..57fe1f586470 100644 --- a/content/media/mediasource/SourceBuffer.cpp +++ b/content/media/mediasource/SourceBuffer.cpp @@ -289,7 +289,15 @@ void SourceBuffer::StopUpdating() { MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(mUpdating); + if (!mUpdating) { + // The buffer append algorithm has been interrupted by abort(). + // + // If the sequence appendBuffer(), abort(), appendBuffer() occurs before + // the first StopUpdating() runnable runs, then a second StopUpdating() + // runnable will be scheduled, but still only one (the first) will queue + // events. + return; + } mUpdating = false; QueueAsyncSimpleEvent("update"); QueueAsyncSimpleEvent("updateend"); diff --git a/testing/web-platform/meta/media-source/SourceBuffer-abort-updating.html.ini b/testing/web-platform/meta/media-source/SourceBuffer-abort-updating.html.ini index be478219659e..84262857e64d 100644 --- a/testing/web-platform/meta/media-source/SourceBuffer-abort-updating.html.ini +++ b/testing/web-platform/meta/media-source/SourceBuffer-abort-updating.html.ini @@ -1,9 +1,5 @@ [SourceBuffer-abort-updating.html] type: testharness - expected: ERROR - [SourceBuffer#abort() (video/webm; codecs="vorbis,vp8") : Check the algorithm when the updating attribute is true.] - expected: FAIL - [SourceBuffer#abort() (video/mp4) : Check the algorithm when the updating attribute is true.] expected: FAIL