stream: Set the object name to the stream id
authorEdward Hervey <edward@centricular.com>
Fri, 28 May 2021 05:54:32 +0000 (07:54 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 20 Oct 2021 05:53:20 +0000 (05:53 +0000)
Makes it more meaningful in debug logs (instead of streamNNNNN)

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

subprojects/gstreamer/gst/gststreams.c

index 6df80d1..1a02187 100644 (file)
@@ -241,6 +241,10 @@ gst_stream_set_stream_id (GstStream * stream, const gchar * stream_id)
         g_random_int (), g_random_int ());
   }
 
+  /* We hold the object lock, replace directly */
+  g_free (GST_OBJECT_NAME (stream));
+  GST_OBJECT_NAME (stream) = g_strdup (stream->stream_id);
+
   GST_OBJECT_UNLOCK (stream);
 
   if (!stream_id)