stream: Don't use GST_FIXME_OBJECT() when generating a random stream id if the caller...
authorSebastian Dröge <sebastian@centricular.com>
Wed, 1 Jul 2020 17:20:16 +0000 (20:20 +0300)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 1 Jul 2020 19:50:20 +0000 (19:50 +0000)
That would call into gst_info_describe_stream(), which takes the same
mutex a second time and then deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/552>

gst/gststreams.c

index 503ce22..77c6299 100644 (file)
@@ -232,18 +232,20 @@ gst_stream_set_stream_id (GstStream * stream, const gchar * stream_id)
 
   GST_OBJECT_LOCK (stream);
   g_assert (stream->stream_id == NULL);
-  if (stream_id)
+  if (stream_id) {
     stream->stream_id = g_strdup (stream_id);
-  else {
+  else {
     /* Create a random stream_id if NULL */
-    GST_FIXME_OBJECT (stream, "Creating random stream-id, consider "
-        "implementing a deterministic way of creating a stream-id");
     stream->stream_id =
         g_strdup_printf ("%08x%08x%08x%08x", g_random_int (), g_random_int (),
         g_random_int (), g_random_int ());
   }
 
   GST_OBJECT_UNLOCK (stream);
+
+  if (!stream_id)
+    GST_FIXME_OBJECT (stream, "Created random stream-id, consider "
+        "implementing a deterministic way of creating a stream-id");
 }
 
 /**