mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 13:21:28 +00:00
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:
parent
1816f74339
commit
f341619a4d
1 changed files with 6 additions and 4 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue