summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatricia Muscalu <patricia@axis.com>2017-10-16 10:10:17 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-11-15 17:46:00 +0200
commitb5c3ef8d53e0768ee4677887bb4808ef1f169ca0 (patch)
tree11fca06af61042fb0a22d12cb737f949fa7d44ed
parent0f87202a71e5560491be66182773e923f7b094ab (diff)
rtsp-media: return minimum value in query position case
The minimum position should be returned as we are interested in the whole interval. Change-Id: I30e297fc040c995ae40c25dee8ff56321612fe2b https://bugzilla.gnome.org/show_bug.cgi?id=788340
-rw-r--r--gst/rtsp-server/rtsp-media.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c
index 058fa90..d3a1f5a 100644
--- a/gst/rtsp-server/rtsp-media.c
+++ b/gst/rtsp-server/rtsp-media.c
@@ -593,9 +593,12 @@ do_query_position (GstRTSPStream * stream, DoQueryPositionData * data)
gint64 tmp;
if (gst_rtsp_stream_query_position (stream, &tmp)) {
- data->position = MAX (data->position, tmp);
+ data->position = MIN (data->position, tmp);
data->ret = TRUE;
}
+
+ GST_INFO_OBJECT (stream, "media position: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (data->position));
}
static gboolean
@@ -606,12 +609,15 @@ default_query_position (GstRTSPMedia * media, gint64 * position)
priv = media->priv;
- data.position = -1;
+ data.position = G_MAXINT64;
data.ret = FALSE;
g_ptr_array_foreach (priv->streams, (GFunc) do_query_position, &data);
- *position = data.position;
+ if (!data.ret)
+ *position = GST_CLOCK_TIME_NONE;
+ else
+ *position = data.position;
return data.ret;
}