2009-11-12 Philippe Normand <pnormand@igalia.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Nov 2009 10:32:22 +0000 (10:32 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Nov 2009 10:32:22 +0000 (10:32 +0000)
        Reviewed by Jan Alonzo.

        https://bugs.webkit.org/show_bug.cgi?id=31047
        [GTK] Failing test media/video-played-ranges-1.html

        don't pause pipeline if already paused, same for play()

        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivate::play):
        (WebCore::MediaPlayerPrivate::pause):

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

WebCore/ChangeLog
WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp

index cfa2c6d7cce434b3d3f7e4c43bdffde409220f46..4c20f5ac19733902dcd8d7f4d5bfe353894dfd31 100644 (file)
@@ -1,3 +1,16 @@
+2009-11-12  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by Jan Alonzo.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31047
+        [GTK] Failing test media/video-played-ranges-1.html
+
+        don't pause pipeline if already paused, same for play()
+
+        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivate::play):
+        (WebCore::MediaPlayerPrivate::pause):
+
 2009-11-12  Kinuko Yasuda  <kinuko@google.com>
 
         Reviewed by David Levin.
index 52b26472a910db4520a3e1ad616806c86aa8659c..091506d30c3e59f58f622344d67bb29fdb720944 100644 (file)
@@ -214,14 +214,26 @@ void MediaPlayerPrivate::load(const String& url)
 
 void MediaPlayerPrivate::play()
 {
-    LOG_VERBOSE(Media, "Play");
-    gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+    GstState state;
+    GstState pending;
+
+    gst_element_get_state(m_playBin, &state, &pending, 0);
+    if (state != GST_STATE_PLAYING && pending != GST_STATE_PLAYING) {
+        LOG_VERBOSE(Media, "Play");
+        gst_element_set_state(m_playBin, GST_STATE_PLAYING);
+    }
 }
 
 void MediaPlayerPrivate::pause()
 {
-    LOG_VERBOSE(Media, "Pause");
-    gst_element_set_state(m_playBin, GST_STATE_PAUSED);
+    GstState state;
+    GstState pending;
+
+    gst_element_get_state(m_playBin, &state, &pending, 0);
+    if (state != GST_STATE_PAUSED  && pending != GST_STATE_PAUSED) {
+        LOG_VERBOSE(Media, "Pause");
+        gst_element_set_state(m_playBin, GST_STATE_PAUSED);
+    }
 }
 
 float MediaPlayerPrivate::duration() const
@@ -284,8 +296,6 @@ void MediaPlayerPrivate::seek(float time)
     else {
         m_seeking = true;
         m_seekTime = sec;
-        // Wait some time for the seek to complete.
-        gst_element_get_state(m_playBin, 0, 0, 40 * GST_MSECOND);
     }
 }