From: Doug Nazar Date: Mon, 19 Apr 2021 05:29:33 +0000 (-0400) Subject: rtspsrc: Fix race saving seek event seqnum. X-Git-Tag: 1.19.3~509^2~148 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b705fb93be41e6fbf6ab8a4bdf5bfd0086df03f4;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 0430a46..a54a457 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -2875,6 +2875,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 */ @@ -2923,11 +2928,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);