summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2020-10-08 22:17:16 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2020-10-08 22:28:04 +0200
commit6d319f8e4914909e43f737a13c4f3a464f406655 (patch)
treedb0138a0b744b644f01f5732925d4f94563dfa46
parenta446ba4fb06a5d8ffb532eb9a4e86dbadcc5b7fc (diff)
rtsp-stream: make use of blocked_running_time in query_position
When blocking, the sink element will not have received a buffer yet and the position query will fail. Instead, we make use of the running time of the buffer we blocked on. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/160>
-rw-r--r--gst/rtsp-server/rtsp-stream.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gst/rtsp-server/rtsp-stream.c b/gst/rtsp-server/rtsp-stream.c
index 5da7105..7585a0c 100644
--- a/gst/rtsp-server/rtsp-stream.c
+++ b/gst/rtsp-server/rtsp-stream.c
@@ -5428,6 +5428,13 @@ gst_rtsp_stream_query_position (GstRTSPStream * stream, gint64 * position)
priv = stream->priv;
g_mutex_lock (&priv->lock);
+
+ if (priv->blocking && GST_CLOCK_TIME_IS_VALID (priv->blocked_running_time)) {
+ *position = priv->blocked_running_time;
+ g_mutex_unlock (&priv->lock);
+ return TRUE;
+ }
+
/* depending on the transport type, it should query corresponding sink */
if (priv->configured_protocols & GST_RTSP_LOWER_TRANS_UDP)
sink = priv->udpsink[0];