stream: Don't use GST_FIXME_OBJECT() when generating a random stream id if the caller didn't provide one

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>
This commit is contained in:
Sebastian Dröge 2020-07-01 20:20:16 +03:00 committed by GStreamer Merge Bot
parent 1816f74339
commit f341619a4d

View 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");
}
/**