summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Nazar <nazard@nazar.ca>2021-04-19 01:29:33 -0400
committerTim-Philipp Müller <tim@centricular.com>2021-04-20 15:13:41 +0100
commit8e1e45ab70ce8751fc85693b95dc2ac74d7e3d31 (patch)
tree5a2f0a7eb544dac87f2e61947e7eaff7de0acc41
parentb59191319bb126f95ea3fca381f2646fbe6304c7 (diff)
downloadgstreamer-plugins-good-8e1e45ab70ce8751fc85693b95dc2ac74d7e3d31.tar.gz
rtspsrc: Fix race saving seek event seqnum.
We need to save the seek seqnum before the flush stop event since that will start the basesrc task which may send the segment event before we're ready. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/957>
-rw-r--r--gst/rtsp/gstrtspsrc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 716fec630..db0361ded 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -2876,6 +2876,11 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
/* PLAY will add the range header now. */
src->need_range = TRUE;
+ /* If an accurate seek was requested, we want to clip the segment we
+ * output in ONVIF mode to the requested bounds */
+ src->clip_out_segment = ! !(flags & GST_SEEK_FLAG_ACCURATE);
+ src->seek_seqnum = gst_event_get_seqnum (event);
+
/* prepare for streaming again */
if (flush) {
/* if we started flush, we stop now */
@@ -2928,11 +2933,6 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
seek_style = "Next";
}
- /* If an accurate seek was requested, we want to clip the segment we
- * output in ONVIF mode to the requested bounds */
- src->clip_out_segment = ! !(flags & GST_SEEK_FLAG_ACCURATE);
- src->seek_seqnum = gst_event_get_seqnum (event);
-
if (playing)
gst_rtspsrc_play (src, &seeksegment, FALSE, seek_style);