summaryrefslogtreecommitdiff
path: root/gst-libs/gst/uridownloader
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-04-28 10:12:52 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-04-28 10:12:52 +0200
commitdede842409cdda579be00eca0f17e242e0b6f34b (patch)
treeaebba3a902d74aeac101ea18cf41465493d88920 /gst-libs/gst/uridownloader
parentb47c92df827c522fe66fa245c2c74d6ad376525f (diff)
downloadgstreamer-plugins-bad-dede842409cdda579be00eca0f17e242e0b6f34b.tar.gz
uridownloader: Unset referer if none was specified later on
Diffstat (limited to 'gst-libs/gst/uridownloader')
-rw-r--r--gst-libs/gst/uridownloader/gsturidownloader.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gst-libs/gst/uridownloader/gsturidownloader.c b/gst-libs/gst/uridownloader/gsturidownloader.c
index 8614c44f6..45f53439a 100644
--- a/gst-libs/gst/uridownloader/gsturidownloader.c
+++ b/gst-libs/gst/uridownloader/gsturidownloader.c
@@ -378,14 +378,19 @@ gst_uri_downloader_set_uri (GstUriDownloader * downloader, const gchar * uri,
g_object_set (downloader->priv->urisrc, "compress", compress, NULL);
if (g_object_class_find_property (gobject_class, "keep-alive"))
g_object_set (downloader->priv->urisrc, "keep-alive", TRUE, NULL);
- if (referer && g_object_class_find_property (gobject_class, "extra-headers")) {
- GstStructure *extra_headers =
- gst_structure_new ("headers", "Referer", G_TYPE_STRING, referer, NULL);
+ if (g_object_class_find_property (gobject_class, "extra-headers")) {
+ if (referer) {
+ GstStructure *extra_headers =
+ gst_structure_new ("headers", "Referer", G_TYPE_STRING, referer,
+ NULL);
- g_object_set (downloader->priv->urisrc, "extra-headers", extra_headers,
- NULL);
+ g_object_set (downloader->priv->urisrc, "extra-headers", extra_headers,
+ NULL);
- gst_structure_free (extra_headers);
+ gst_structure_free (extra_headers);
+ } else {
+ g_object_set (downloader->priv->urisrc, "extra-headers", NULL, NULL);
+ }
}
/* add a sync handler for the bus messages to detect errors in the download */