[GStreamer] HLS stream slow start
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jun 2019 14:04:36 +0000 (14:04 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jun 2019 14:04:36 +0000 (14:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198377

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcCreate): Cut down the adapter condition to 200 ms to
improve start-up times for HLS playback.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp

index 3b25d88..b84bf5e 100644 (file)
@@ -1,3 +1,14 @@
+2019-06-13  Philippe Normand  <pnormand@igalia.com>
+
+        [GStreamer] HLS stream slow start
+        https://bugs.webkit.org/show_bug.cgi?id=198377
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcCreate): Cut down the adapter condition to 200 ms to
+        improve start-up times for HLS playback.
+
 2019-06-13  Ludovico de Nittis  <ludovico.denittis@collabora.com>
 
         [GTK] gdk_display_get_device_manager and gdk_screen_get_width/height are deprecated
index 3f6c2f3..cff19ab 100644 (file)
@@ -389,7 +389,9 @@ static GstFlowReturn webKitWebSrcCreate(GstPushSrc* pushSrc, GstBuffer** buffer)
         unsigned retries = 0;
         size_t available = gst_adapter_available_fast(priv->adapter.get());
         while (available < size && !isAdapterDrained) {
-            priv->adapterCondition.waitFor(priv->adapterLock, Seconds(1));
+            priv->adapterCondition.waitFor(priv->adapterLock, 200_ms, [&] {
+                return gst_adapter_available_fast(priv->adapter.get()) >= size;
+            });
             retries++;
             available = gst_adapter_available_fast(priv->adapter.get());
             if (available && available < size)