rtsp-media: Force seek when flush flag is set
authorKristofer Bjorkstrom <kristofb@pc36402-1937.se.axis.com>
Fri, 6 Dec 2019 09:44:35 +0000 (10:44 +0100)
committerKristofer Bjorkstrom <kristofb@pc36402-1937.se.axis.com>
Fri, 6 Dec 2019 13:52:23 +0000 (14:52 +0100)
The commit "rtsp-client: define all seek accuracy flags from
setup_play_mode" changed the behaviour of when doing a seek.

Before that commit, having the flush flag set would result in a seek
(forced seek).
Even if no seek was needed. One reason to force seek is to flush old buffers
created in Describe requests.

Thus adding force seek also for flush flag will result in play request
with fresh buffers.

gst/rtsp-server/rtsp-media.c

index 4516d53..260ee6d 100644 (file)
@@ -2817,9 +2817,10 @@ gst_rtsp_media_seek_trickmode (GstRTSPMedia * media,
   if (stop != GST_CLOCK_TIME_NONE)
     stop_type = GST_SEEK_TYPE_SET;
 
-  /* we force a seek if any trickmode flag is set, or if the rate
-   * is non-standard, i.e. not 1.0 */
-  force_seek = (flags & TRICKMODE_FLAGS) || rate != 1.0;
+  /* we force a seek if any trickmode flag is set, or if the flush flag is set or
+   * the rate is non-standard, i.e. not 1.0 */
+  force_seek = (flags & TRICKMODE_FLAGS) || (flags & GST_SEEK_FLAG_FLUSH) ||
+      rate != 1.0;
 
   if (start != GST_CLOCK_TIME_NONE || stop != GST_CLOCK_TIME_NONE || force_seek) {
     GST_INFO ("seeking to %" GST_TIME_FORMAT " - %" GST_TIME_FORMAT,