dataurisrc: Make get_uri() threadsafe
authorVineeth T M <vineeth.tm@samsung.com>
Tue, 2 Sep 2014 06:41:44 +0000 (12:11 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 2 Sep 2014 06:56:41 +0000 (09:56 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=735861

gst/dataurisrc/gstdataurisrc.c

index ba8b9a3..1fde36d 100644 (file)
@@ -302,9 +302,12 @@ static gchar *
 gst_data_uri_src_get_uri (GstURIHandler * handler)
 {
   GstDataURISrc *src = GST_DATA_URI_SRC (handler);
+  gchar *src_uri = NULL;
 
-  /* FIXME: make thread-safe */
-  return g_strdup (src->uri);
+  GST_OBJECT_LOCK (src);
+  src_uri = g_strdup (src->uri);
+  GST_OBJECT_UNLOCK (src);
+  return src_uri;
 }
 
 static gboolean