diff --git a/content/media/video/public/nsAudioStream.h b/content/media/video/public/nsAudioStream.h index c9a7fce5bee8..d030c6cc20a9 100644 --- a/content/media/video/public/nsAudioStream.h +++ b/content/media/video/public/nsAudioStream.h @@ -63,6 +63,7 @@ class nsAudioStream static void ShutdownLibrary(); nsAudioStream(); + ~nsAudioStream(); // Initialize the audio stream. aNumChannels is the number of audio channels // (1 for mono, 2 for stereo, etc) and aRate is the frequency of the sound diff --git a/content/media/video/src/nsAudioStream.cpp b/content/media/video/src/nsAudioStream.cpp index 011684a264ed..523726ed3942 100644 --- a/content/media/video/src/nsAudioStream.cpp +++ b/content/media/video/src/nsAudioStream.cpp @@ -72,6 +72,11 @@ nsAudioStream::nsAudioStream() : { } +nsAudioStream::~nsAudioStream() +{ + Shutdown(); +} + void nsAudioStream::Init(PRInt32 aNumChannels, PRInt32 aRate, SampleFormat aFormat) { mRate = aRate; diff --git a/content/media/video/src/nsOggDecoder.cpp b/content/media/video/src/nsOggDecoder.cpp index 5da81a35ada5..5a53ad8a4b22 100644 --- a/content/media/video/src/nsOggDecoder.cpp +++ b/content/media/video/src/nsOggDecoder.cpp @@ -916,6 +916,9 @@ nsresult nsOggDecodeStateMachine::Run() nsAutoMonitor mon(mDecoder->GetMonitor()); switch(mState) { case DECODER_STATE_SHUTDOWN: + if (mPlaying) { + StopPlayback(); + } return NS_OK; case DECODER_STATE_DECODING_METADATA: