Unreviewed, rolling out r219194.
[WebKit.git] / Source / WebCore / platform / graphics / gstreamer / MediaPlayerPrivateGStreamer.cpp
index 119ce68..dd48e32 100644 (file)
@@ -210,22 +210,6 @@ MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer()
     }
 }
 
-void MediaPlayerPrivateGStreamer::setPlaybinURL(const URL& url)
-{
-    // Clean out everything after file:// url path.
-    String cleanURLString(url.string());
-    if (url.isLocalFile())
-        cleanURLString = cleanURLString.substring(0, url.pathEnd());
-
-    m_url = URL(URL(), cleanURLString);
-
-    if (m_url.protocolIsInHTTPFamily())
-        m_url.setProtocol("webkit+" + url.protocol());
-
-    GST_INFO("Load %s", cleanURLString.utf8().data());
-    g_object_set(m_pipeline.get(), "uri", cleanURLString.utf8().data(), nullptr);
-}
-
 void MediaPlayerPrivateGStreamer::load(const String& urlString)
 {
     if (!MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements())
@@ -235,6 +219,11 @@ void MediaPlayerPrivateGStreamer::load(const String& urlString)
     if (url.isBlankURL())
         return;
 
+    // Clean out everything after file:// url path.
+    String cleanURL(urlString);
+    if (url.isLocalFile())
+        cleanURL = cleanURL.substring(0, url.pathEnd());
+
     if (!m_pipeline)
         createGSTPlayBin();
 
@@ -243,7 +232,10 @@ void MediaPlayerPrivateGStreamer::load(const String& urlString)
 
     ASSERT(m_pipeline);
 
-    setPlaybinURL(url);
+    m_url = URL(URL(), cleanURL);
+    g_object_set(m_pipeline.get(), "uri", cleanURL.utf8().data(), nullptr);
+
+    GST_INFO("Load %s", cleanURL.utf8().data());
 
     if (m_preload == MediaPlayer::None) {
         GST_DEBUG("Delaying load.");
@@ -1687,7 +1679,8 @@ bool MediaPlayerPrivateGStreamer::loadNextLocation()
             gst_element_get_state(m_pipeline.get(), &state, nullptr, 0);
             if (state <= GST_STATE_READY) {
                 // Set the new uri and start playing.
-                setPlaybinURL(newUrl);
+                g_object_set(m_pipeline.get(), "uri", newUrl.string().utf8().data(), nullptr);
+                m_url = newUrl;
                 changePipelineState(GST_STATE_PLAYING);
                 return true;
             }