Title: [218703] trunk/Source/WebCore
Revision
218703
Author
[email protected]
Date
2017-06-22 09:43:52 -0700 (Thu, 22 Jun 2017)

Log Message

[GTK] Spreaker live shows won't play
https://bugs.webkit.org/show_bug.cgi?id=173306

Patch by Charlie Turner <[email protected]> on 2017-06-22
Reviewed by Xabier Rodriguez-Calvar.

This was due to removing the code that negotiated caps for Icecast
streams based on the response headers in r191947. The problem is that
the typefind element can sometimes squint hard enough and see an MP3
stream and attempt to play it, resulting in garbled audio playback. More
commonly typefind fails to recognize the Icecast stream and bails,
resulting in no playback at all.

r191947 also removed the emission of metadata into the pipeline. This
patch also leaves that out since we have no use for it within WebKit.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(StreamingClient::handleResponseReceived):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (218702 => 218703)


--- trunk/Source/WebCore/ChangeLog	2017-06-22 16:33:55 UTC (rev 218702)
+++ trunk/Source/WebCore/ChangeLog	2017-06-22 16:43:52 UTC (rev 218703)
@@ -1,3 +1,23 @@
+2017-06-22  Charlie Turner  <[email protected]>
+
+        [GTK] Spreaker live shows won't play
+        https://bugs.webkit.org/show_bug.cgi?id=173306
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        This was due to removing the code that negotiated caps for Icecast
+        streams based on the response headers in r191947. The problem is that
+        the typefind element can sometimes squint hard enough and see an MP3
+        stream and attempt to play it, resulting in garbled audio playback. More
+        commonly typefind fails to recognize the Icecast stream and bails,
+        resulting in no playback at all.
+
+        r191947 also removed the emission of metadata into the pipeline. This
+        patch also leaves that out since we have no use for it within WebKit.
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (StreamingClient::handleResponseReceived):
+
 2017-06-22  Matt Lewis  <[email protected]>
 
         Unreviewed, rolling out r218633.

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (218702 => 218703)


--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2017-06-22 16:33:55 UTC (rev 218702)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2017-06-22 16:43:52 UTC (rev 218703)
@@ -956,7 +956,16 @@
     } else
         gst_app_src_set_size(priv->appsrc, -1);
 
-    gst_app_src_set_caps(priv->appsrc, nullptr);
+    // Signal to downstream if this is an Icecast stream.
+    GRefPtr<GstCaps> caps;
+    String metadataIntervalAsString = response.httpHeaderField(HTTPHeaderName::IcyMetaInt);
+    if (!metadataIntervalAsString.isEmpty()) {
+        bool isMetadataIntervalParsed;
+        int metadataInterval = metadataIntervalAsString.toInt(&isMetadataIntervalParsed);
+        if (isMetadataIntervalParsed && metadataInterval > 0)
+            caps = adoptGRef(gst_caps_new_simple("application/x-icy", "metadata-interval", G_TYPE_INT, metadataInterval, nullptr));
+    }
+    gst_app_src_set_caps(priv->appsrc, caps.get());
 
     // Emit a GST_EVENT_CUSTOM_DOWNSTREAM_STICKY event to let GStreamer know about the HTTP headers sent and received.
     GstStructure* httpHeaders = gst_structure_new_empty("http-headers");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to