mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
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
This commit is contained in:
parent
0f87202a71
commit
b5c3ef8d53
1 changed files with 9 additions and 3 deletions
|
@ -593,9 +593,12 @@ do_query_position (GstRTSPStream * stream, DoQueryPositionData * data)
|
||||||
gint64 tmp;
|
gint64 tmp;
|
||||||
|
|
||||||
if (gst_rtsp_stream_query_position (stream, &tmp)) {
|
if (gst_rtsp_stream_query_position (stream, &tmp)) {
|
||||||
data->position = MAX (data->position, tmp);
|
data->position = MIN (data->position, tmp);
|
||||||
data->ret = TRUE;
|
data->ret = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_INFO_OBJECT (stream, "media position: %" GST_TIME_FORMAT,
|
||||||
|
GST_TIME_ARGS (data->position));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -606,12 +609,15 @@ default_query_position (GstRTSPMedia * media, gint64 * position)
|
||||||
|
|
||||||
priv = media->priv;
|
priv = media->priv;
|
||||||
|
|
||||||
data.position = -1;
|
data.position = G_MAXINT64;
|
||||||
data.ret = FALSE;
|
data.ret = FALSE;
|
||||||
|
|
||||||
g_ptr_array_foreach (priv->streams, (GFunc) do_query_position, &data);
|
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;
|
return data.ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue