Bug 875483 - YouTube HTML5 Playback hangs Firefox. r=derf,a=tef+
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 28 May 2013 16:46:55 +1200
changeset 119455 611d727390a40db609670ee077df82aa29f2d701
parent 119454 b2dbbdda1b4dcfd80d5fbdebf6c91494114495af
child 119456 77740fdf4e844b9193f5f7c8a9f2b6bcd3e8a170
push id830
push userrocallahan@mozilla.com
push dateTue, 28 May 2013 04:49:40 +0000
reviewersderf, tef
bugs875483
milestone18.0
Bug 875483 - YouTube HTML5 Playback hangs Firefox. r=derf,a=tef+
content/html/content/src/nsHTMLMediaElement.cpp
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -1538,16 +1538,20 @@ void nsHTMLMediaElement::SetVolumeIntern
     mAudioStream->SetVolume(effectiveVolume);
   } else if (mSrcStream) {
     GetSrcMediaStream()->SetAudioOutputVolume(this, effectiveVolume);
   }
 }
 
 NS_IMETHODIMP nsHTMLMediaElement::SetMuted(bool aMuted)
 {
+  if (aMuted == (mMuted & MUTED_BY_CONTENT)) {
+    return NS_OK;
+  }
+
   if (aMuted) {
     SetMutedInternal(mMuted | MUTED_BY_CONTENT);
   } else {
     SetMutedInternal(mMuted & ~MUTED_BY_CONTENT);
   }
 
   DispatchAsyncEvent(NS_LITERAL_STRING("volumechange"));