From 707ebf378925de7153decdfc96c143ebb7009fe6 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 31 Jan 2023 15:28:22 +0100 Subject: [PATCH] rtpssrcdemux: set different stream-id on each src pad All the RTP src pads were sharing the same stream-id while each actually carry a different stream. This was causing problem for example when funneling the streams together and then trying to split them using 'streamiddemux'. Part-of: --- .../gst/rtpmanager/gstrtpssrcdemux.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpssrcdemux.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpssrcdemux.c index 9713131e1b..243449be28 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpssrcdemux.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpssrcdemux.c @@ -226,6 +226,30 @@ add_ssrc_and_ref (GstEvent * event, guint32 ssrc) gst_caps_unref (newcaps); break; } + case GST_EVENT_STREAM_START: + { + const gchar *stream_id; + gchar *new_stream_id; + guint group_id; + GstStreamFlags flags; + GstEvent *new_event; + + gst_event_parse_stream_start (event, &stream_id); + + new_stream_id = + g_strdup_printf ("%s/%u", stream_id ? stream_id : "", ssrc); + new_event = gst_event_new_stream_start (new_stream_id); + g_free (new_stream_id); + + if (gst_event_parse_group_id (event, &group_id)) + gst_event_set_group_id (new_event, group_id); + gst_event_parse_stream_flags (event, &flags); + gst_event_set_stream_flags (new_event, flags); + + event = new_event; + + break; + } default: gst_event_ref (event); break;