From 235241a00d0102a80eb8f7c8882c90bd39b36b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 31 Aug 2018 12:12:13 +0300 Subject: [PATCH] Revert "pad: Don't drop LATENCY queries with default implementation" This reverts commit 794944f779f954375fc74a3fffcc2067bba6a3e5. Accumulating non-live latency values generally makes no sense and often gives invalid results with min>max --- gst/gstpad.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gst/gstpad.c b/gst/gstpad.c index bb9e95ba05..da9f866a4f 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -3246,7 +3246,6 @@ done: /* Default latency implementation */ typedef struct { - guint count; gboolean live; GstClockTime min, max; } LatencyFoldData; @@ -3278,8 +3277,7 @@ query_latency_default_fold (const GValue * item, GValue * ret, GST_LOG_OBJECT (pad, "got latency live:%s min:%" G_GINT64_FORMAT " max:%" G_GINT64_FORMAT, live ? "true" : "false", min, max); - /* FIXME : Why do we only take values into account if it's live ? */ - if (live || fold_data->count == 0) { + if (live) { if (min > fold_data->min) fold_data->min = min; @@ -3288,9 +3286,8 @@ query_latency_default_fold (const GValue * item, GValue * ret, else if (max < fold_data->max) fold_data->max = max; - fold_data->live = live; + fold_data->live = TRUE; } - fold_data->count += 1; } else if (peer) { GST_DEBUG_OBJECT (pad, "latency query failed"); g_value_set_boolean (ret, FALSE); @@ -3321,7 +3318,6 @@ gst_pad_query_latency_default (GstPad * pad, GstQuery * query) g_value_init (&ret, G_TYPE_BOOLEAN); retry: - fold_data.count = 0; fold_data.live = FALSE; fold_data.min = 0; fold_data.max = GST_CLOCK_TIME_NONE;