From 5a48de94d77507db266e9e05242f93fe566f56a1 Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Thu, 3 Apr 2008 02:02:53 +0000 Subject: [PATCH] [MOVED FROM GST-P-FARSIGHT] For latencies, use the min of the max and the max of the min (and the min wins if they cross) 20080403020253-3e2dc-dda7e471073ee75a6f60e845c3c546af9be19675.gz --- gst/liveadder/liveadder.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c index fd45255200..ac349b9591 100644 --- a/gst/liveadder/liveadder.c +++ b/gst/liveadder/liveadder.c @@ -634,8 +634,8 @@ gst_live_adder_query (GstPad * pad, GstQuery * query) GST_PAD_NAME (sinkpad), GST_TIME_ARGS (pad_min_latency), GST_TIME_ARGS (pad_max_latency)); - min_latency = MIN (pad_min_latency, min_latency); - max_latency = MAX (pad_max_latency, max_latency); + min_latency = MAX (pad_min_latency, min_latency); + max_latency = MIN (pad_max_latency, max_latency); } gst_object_unref (item); } @@ -661,6 +661,9 @@ gst_live_adder_query (GstPad * pad, GstQuery * query) if (min_latency == G_MAXUINT64) min_latency = 0; + if (max_latency < min_latency) + max_latency = min_latency; + GST_OBJECT_LOCK (adder); adder->peer_latency = min_latency; min_latency += adder->latency_ms * GST_MSECOND; @@ -1122,7 +1125,7 @@ gst_live_adder_loop (gpointer data) /* * We should probably loop through all of the sinks that have a segment * and take the min of the starts and the max of the stops - * and convert them to running times and use these are start/stop. + * and convert them to running times and use these as start/stop. * And so something smart about the positions with seeks that I dont * understand yet. */