mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
pad: Don't drop LATENCY queries with default implementation
If there is only one pad in the internal pads, when folding for LATENCY queries it will just drop the response if it's not live. This is maybe not the proper fix, but it will just accept the first peer responses, and if there are any other pads, it will only take them into account if the response is live. This *should* properly handle the aggregation/folding behaviour of multiple live peer responses, while at the same time handling the simple one-pad-only-and-forward use-case https://bugzilla.gnome.org/show_bug.cgi?id=766360
This commit is contained in:
parent
9e23670671
commit
794944f779
1 changed files with 6 additions and 2 deletions
|
@ -3175,6 +3175,7 @@ done:
|
|||
/* Default latency implementation */
|
||||
typedef struct
|
||||
{
|
||||
guint count;
|
||||
gboolean live;
|
||||
GstClockTime min, max;
|
||||
} LatencyFoldData;
|
||||
|
@ -3206,7 +3207,8 @@ 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);
|
||||
|
||||
if (live) {
|
||||
/* FIXME : Why do we only take values into account if it's live ? */
|
||||
if (live || fold_data->count == 0) {
|
||||
if (min > fold_data->min)
|
||||
fold_data->min = min;
|
||||
|
||||
|
@ -3215,8 +3217,9 @@ query_latency_default_fold (const GValue * item, GValue * ret,
|
|||
else if (max < fold_data->max)
|
||||
fold_data->max = max;
|
||||
|
||||
fold_data->live = TRUE;
|
||||
fold_data->live = live;
|
||||
}
|
||||
fold_data->count += 1;
|
||||
} else if (peer) {
|
||||
GST_DEBUG_OBJECT (pad, "latency query failed");
|
||||
g_value_set_boolean (ret, FALSE);
|
||||
|
@ -3247,6 +3250,7 @@ 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;
|
||||
|
|
Loading…
Reference in a new issue