summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2021-04-10 03:09:44 +0530
committerTim-Philipp Müller <tim@centricular.com>2021-09-06 23:17:20 +0100
commit1629d4fbab81f01ca8a2d63e424956a5ecce1c00 (patch)
treea23f58756bf0d148f4c6383e31ac27c54cde9c95
parent93ee65f05769ccb10fc0bf970a99a4ce01720919 (diff)
downloadgstreamer-plugins-good-1629d4fbab81f01ca8a2d63e424956a5ecce1c00.tar.gz
rtspsrc: De-dup seek event seqnums to avoid multiple seeks
Seek events are sent upstream on each sink, so if we receive multiple seeks with the same seqnum, we must only perform one seek, not N seeks where N = the number of sinks in the pipeline connected to rtspsrc. This is the same thing done by demuxers like qtdemux or matrsokademux. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1075>
-rw-r--r--gst/rtsp/gstrtspsrc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index db0361ded..f5d6b708f 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -2973,7 +2973,15 @@ gst_rtspsrc_handle_src_event (GstPad * pad, GstObject * parent,
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:
- res = gst_rtspsrc_perform_seek (src, event);
+ {
+ guint32 seqnum = gst_event_get_seqnum (event);
+ if (seqnum == src->seek_seqnum) {
+ GST_LOG_OBJECT (pad, "Drop duplicated SEEK event seqnum %"
+ G_GUINT32_FORMAT, seqnum);
+ } else {
+ res = gst_rtspsrc_perform_seek (src, event);
+ }
+ }
forward = FALSE;
break;
case GST_EVENT_QOS: