diff --git a/dom/media/AudioSink.cpp b/dom/media/AudioSink.cpp index 19305695f4..d370046737 100644 --- a/dom/media/AudioSink.cpp +++ b/dom/media/AudioSink.cpp @@ -257,7 +257,10 @@ AudioSink::Cleanup() AssertCurrentThreadInMonitor(); nsRefPtr audioStream; audioStream.swap(mAudioStream); - mStateMachine->DispatchOnAudioSinkComplete(); + // Suppress the callback when the stop is requested by MediaDecoderStateMachine. + if (!mStopAudioThread) { + mStateMachine->DispatchOnAudioSinkComplete(); + } ReentrantMonitorAutoExit exit(GetReentrantMonitor()); audioStream->Shutdown();