diff --git a/content/media/MediaDecoderStateMachine.cpp b/content/media/MediaDecoderStateMachine.cpp index 7e7f38e8c20..457afc2f156 100644 --- a/content/media/MediaDecoderStateMachine.cpp +++ b/content/media/MediaDecoderStateMachine.cpp @@ -506,7 +506,8 @@ void MediaDecoderStateMachine::SendStreamAudio(AudioData* aAudio, DecodedStreamData* aStream, AudioSegment* aOutput) { - NS_ASSERTION(OnDecodeThread(), "Should be on decode thread."); + NS_ASSERTION(OnDecodeThread() || + OnStateMachineThread(), "Should be on decode thread or state machine thread"); mDecoder->GetReentrantMonitor().AssertCurrentThreadIn(); if (aAudio->mTime <= aStream->mLastAudioPacketTime) { @@ -1210,7 +1211,7 @@ uint32_t MediaDecoderStateMachine::PlaySilence(uint32_t aFrames, } uint32_t MediaDecoderStateMachine::PlayFromAudioQueue(uint64_t aFrameOffset, - uint32_t aChannels) + uint32_t aChannels) { NS_ASSERTION(OnAudioThread(), "Only call on audio thread."); NS_ASSERTION(!mAudioStream->IsPaused(), "Don't play when paused"); @@ -1218,7 +1219,6 @@ uint32_t MediaDecoderStateMachine::PlayFromAudioQueue(uint64_t aFrameOffset, { ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); NS_WARN_IF_FALSE(IsPlaying(), "Should be playing"); - NS_ASSERTION(!mAudioCaptured, "Audio cannot be captured here!"); // Awaken the decode loop if it's waiting for space to free up in the // audio queue. mDecoder->GetReentrantMonitor().NotifyAll(); diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index d309c14d261..d19837cd6a7 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -133,6 +133,7 @@ MOCHITEST_FILES = \ test_media_sniffer.html \ contentType.sjs \ test_streams_srcObject.html \ + test_streams_gc.html \ $(filter disabled-for-intermittent-failures--bug-608634, test_error_in_video_document.html) \ $(NULL) diff --git a/content/media/test/test_streams_gc.html b/content/media/test/test_streams_gc.html new file mode 100644 index 00000000000..545b0c19286 --- /dev/null +++ b/content/media/test/test_streams_gc.html @@ -0,0 +1,45 @@ + + + + Test garbage collection of captured stream (bug 806754) + + + + + + +
+
+
+ +