Leaving a streaming movie by going "Back" keeps playing the audio
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Apr 2014 16:29:32 +0000 (16:29 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Apr 2014 16:29:32 +0000 (16:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131149

Reviewed by Eric Carlson.

When stopping a HTMLMediaElement, call userCancelledLoad() (which clears the
MediaPlayer) only after calling setPausedInternal() (which pauses the MediaPlayer).
Previously, and in the reverse order, the MediaPlayer would never get a chance to pause
before being cleared. There is an underlying error with the QTKit media engine which
is causing it to continue playing even after its last reference is released, but this
does fix the symptom of playback continuing even after stopping.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::stop):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166722 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp

index 0d6db3fcced220f21332309f671560b2c1c5b4b6..c1d347e9ff919c51c6ec8ed5b6184d5db9733065 100644 (file)
@@ -1,3 +1,20 @@
+2014-04-03  Jer Noble  <jer.noble@apple.com>
+
+        Leaving a streaming movie by going "Back" keeps playing the audio
+        https://bugs.webkit.org/show_bug.cgi?id=131149
+
+        Reviewed by Eric Carlson.
+
+        When stopping a HTMLMediaElement, call userCancelledLoad() (which clears the
+        MediaPlayer) only after calling setPausedInternal() (which pauses the MediaPlayer).
+        Previously, and in the reverse order, the MediaPlayer would never get a chance to pause
+        before being cleared. There is an underlying error with the QTKit media engine which
+        is causing it to continue playing even after its last reference is released, but this
+        does fix the symptom of playback continuing even after stopping.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::stop):
+
 2014-04-03  Jer Noble  <jer.noble@apple.com>
 
         [EME] Crash when passing a NULL initData to MediaKeys.createSession()
 2014-04-03  Jer Noble  <jer.noble@apple.com>
 
         [EME] Crash when passing a NULL initData to MediaKeys.createSession()
index 6e7478fa69437e4ce2f000db7841f46da67f8c51..965f7592d7f943b76a950a231e66201ae3ee431b 100644 (file)
@@ -4600,12 +4600,13 @@ void HTMLMediaElement::stop()
         exitFullscreen();
     
     m_inActiveDocument = false;
         exitFullscreen();
     
     m_inActiveDocument = false;
-    userCancelledLoad();
-    
+
     // Stop the playback without generating events
     m_playing = false;
     setPausedInternal(true);
     // Stop the playback without generating events
     m_playing = false;
     setPausedInternal(true);
-    
+
+    userCancelledLoad();
+
     if (renderer())
         renderer()->updateFromElement();
     
     if (renderer())
         renderer()->updateFromElement();