From 14ce96a45942006eda994079b2edaca7b6ccf458 Mon Sep 17 00:00:00 2001 From: Changbok Chea Date: Fri, 7 Oct 2016 16:20:24 +0900 Subject: [PATCH] urisourcebin: Fix adaptive demuxer's property checking and buffering setting - Add adaptive demuxer's 'connection-speed' property checking - Set adaptive demuxer q2 buffering property via urisrc use_buffering value https://bugzilla.gnome.org/show_bug.cgi?id=772550 --- gst/playback/gsturisourcebin.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gst/playback/gsturisourcebin.c b/gst/playback/gsturisourcebin.c index a2f9a18..fa61e0f 100644 --- a/gst/playback/gsturisourcebin.c +++ b/gst/playback/gsturisourcebin.c @@ -968,7 +968,6 @@ pending_pad_blocked (GstPad * pad, GstPadProbeInfo * info, gpointer user_data) if (caps == NULL) caps = gst_pad_query_caps (pad, NULL); - /* FIXME: Don't do buffering if use_buffering is FALSE */ slot = get_output_slot (urisrc, FALSE, TRUE, caps); gst_caps_unref (caps); @@ -1176,11 +1175,11 @@ get_output_slot (GstURISourceBin * urisrc, gboolean do_download, } else { if (is_adaptive) { GST_LOG_OBJECT (urisrc, "Adding queue for adaptive streaming stream"); - g_object_set (queue, "use-buffering", TRUE, "use-tags-bitrate", TRUE, - "use-rate-estimate", FALSE, NULL); + g_object_set (queue, "use-buffering", urisrc->use_buffering, + "use-tags-bitrate", TRUE, "use-rate-estimate", FALSE, NULL); } else { GST_LOG_OBJECT (urisrc, "Adding queue for buffering"); - g_object_set (queue, "use-buffering", TRUE, NULL); + g_object_set (queue, "use-buffering", urisrc->use_buffering, NULL); } g_object_set (queue, "ring-buffer-max-size", urisrc->ring_buffer_max_size, NULL); @@ -1768,6 +1767,7 @@ make_demuxer (GstURISourceBin * urisrc, GstCaps * caps) { GList *factories, *eligible, *cur; GstElement *demuxer = NULL; + GParamSpec *pspec; GST_LOG_OBJECT (urisrc, "making new adaptive demuxer"); @@ -1814,9 +1814,11 @@ make_demuxer (GstURISourceBin * urisrc, GstCaps * caps) "pad-removed", G_CALLBACK (pad_removed_cb), urisrc); /* Propagate connection-speed property */ - /* FIXME: Check the property exists on the demuxer */ - g_object_set (demuxer, - "connection-speed", urisrc->connection_speed / 1000, NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (demuxer), + "connection-speed"); + if (pspec != NULL) + g_object_set (demuxer, + "connection-speed", urisrc->connection_speed / 1000, NULL); return demuxer; -- 2.7.4