mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 17:48:26 +00:00
Revert "pad: Don't drop LATENCY queries with default implementation"
This reverts commit 794944f779
.
Accumulating non-live latency values generally makes no sense and often
gives invalid results with min>max
This commit is contained in:
parent
5c4317c399
commit
e6e22af828
1 changed files with 2 additions and 6 deletions
|
@ -3242,7 +3242,6 @@ done:
|
||||||
/* Default latency implementation */
|
/* Default latency implementation */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
guint count;
|
|
||||||
gboolean live;
|
gboolean live;
|
||||||
GstClockTime min, max;
|
GstClockTime min, max;
|
||||||
} LatencyFoldData;
|
} LatencyFoldData;
|
||||||
|
@ -3274,8 +3273,7 @@ query_latency_default_fold (const GValue * item, GValue * ret,
|
||||||
GST_LOG_OBJECT (pad, "got latency live:%s min:%" G_GINT64_FORMAT
|
GST_LOG_OBJECT (pad, "got latency live:%s min:%" G_GINT64_FORMAT
|
||||||
" max:%" G_GINT64_FORMAT, live ? "true" : "false", min, max);
|
" max:%" G_GINT64_FORMAT, live ? "true" : "false", min, max);
|
||||||
|
|
||||||
/* FIXME : Why do we only take values into account if it's live ? */
|
if (live) {
|
||||||
if (live || fold_data->count == 0) {
|
|
||||||
if (min > fold_data->min)
|
if (min > fold_data->min)
|
||||||
fold_data->min = min;
|
fold_data->min = min;
|
||||||
|
|
||||||
|
@ -3284,9 +3282,8 @@ query_latency_default_fold (const GValue * item, GValue * ret,
|
||||||
else if (max < fold_data->max)
|
else if (max < fold_data->max)
|
||||||
fold_data->max = max;
|
fold_data->max = max;
|
||||||
|
|
||||||
fold_data->live = live;
|
fold_data->live = TRUE;
|
||||||
}
|
}
|
||||||
fold_data->count += 1;
|
|
||||||
} else if (peer) {
|
} else if (peer) {
|
||||||
GST_DEBUG_OBJECT (pad, "latency query failed");
|
GST_DEBUG_OBJECT (pad, "latency query failed");
|
||||||
g_value_set_boolean (ret, FALSE);
|
g_value_set_boolean (ret, FALSE);
|
||||||
|
@ -3317,7 +3314,6 @@ gst_pad_query_latency_default (GstPad * pad, GstQuery * query)
|
||||||
g_value_init (&ret, G_TYPE_BOOLEAN);
|
g_value_init (&ret, G_TYPE_BOOLEAN);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
fold_data.count = 0;
|
|
||||||
fold_data.live = FALSE;
|
fold_data.live = FALSE;
|
||||||
fold_data.min = 0;
|
fold_data.min = 0;
|
||||||
fold_data.max = GST_CLOCK_TIME_NONE;
|
fold_data.max = GST_CLOCK_TIME_NONE;
|
||||||
|
|
Loading…
Reference in a new issue