summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChrisDuncanAnyvision <chrisd@anyvision.co>2020-11-10 16:17:23 +0000
committerTim-Philipp Müller <tim@centricular.com>2020-11-11 10:07:23 +0000
commit35f52729fc8bd962bd7676ca4b656932f4cbbad4 (patch)
tree68f41225c8de08cee39446e9847f54bac6e218e7
parent10c6262179ee66ff03ed7dbebf46068b89db93b0 (diff)
downloadgstreamer-plugins-good-35f52729fc8bd962bd7676ca4b656932f4cbbad4.tar.gz
rtspsrc: Use consistent URI hashed stream-id for UDP and TCP/Interleaved streams
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/814>
-rw-r--r--gst/rtsp/gstrtspsrc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 21321e879..b34e3c03f 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -2998,12 +2998,17 @@ gst_rtspsrc_handle_src_sink_event (GstPad * pad, GstObject * parent,
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_STREAM_START:{
- const gchar *upstream_id;
+ GChecksum *cs;
+ gchar *uri;
gchar *stream_id;
- gst_event_parse_stream_start (event, &upstream_id);
- stream_id = g_strdup_printf ("%s/%s", upstream_id, stream->stream_id);
-
+ cs = g_checksum_new (G_CHECKSUM_SHA256);
+ uri = self->conninfo.location;
+ g_checksum_update (cs, (const guchar *) uri, strlen (uri));
+ stream_id =
+ g_strdup_printf ("%s/%s", g_checksum_get_string (cs),
+ stream->stream_id);
+ g_checksum_free (cs);
gst_event_unref (event);
event = gst_event_new_stream_start (stream_id);
g_free (stream_id);