rtsp-media: Add one more case to seek avoidance
authorEdward Hervey <edward@centricular.com>
Fri, 23 Apr 2021 05:18:48 +0000 (07:18 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 23 Apr 2021 05:18:48 +0000 (07:18 +0200)
This is an extension to the previous commit. There can also be cases where the
start position is not specified, in those cases we should also avoid doing
seeking unless it's forced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/197>

gst/rtsp-server/rtsp-media.c

index 98c719d..55d2b31 100644 (file)
@@ -2946,7 +2946,8 @@ gst_rtsp_media_seek_trickmode (GstRTSPMedia * media,
       }
     }
 
-    if (!force_seek && start == current_position &&
+    if (!force_seek &&
+        (start_type == GST_SEEK_TYPE_NONE || start == current_position) &&
         (stop_type == GST_SEEK_TYPE_NONE || stop == priv->range_stop)) {
       GST_DEBUG ("no position change, no flags set by caller, so not seeking");
       res = TRUE;