summaryrefslogtreecommitdiffstats
path: root/gst/liveadder
diff options
context:
space:
mode:
authorOlivier Crete <olivier.crete@collabora.co.uk>2008-04-03 02:02:53 +0000
committerEdward Hervey <bilboed@bilboed.com>2009-02-17 19:29:03 +0100
commit5a48de94d77507db266e9e05242f93fe566f56a1 (patch)
tree1096b0ae8a660751a575546c5139548f9b24e345 /gst/liveadder
parent1e7eeda1155fe5c1099341f63d931b6db3a3249f (diff)
downloadgst-plugins-bad-5a48de94d77507db266e9e05242f93fe566f56a1.tar.gz
gst-plugins-bad-5a48de94d77507db266e9e05242f93fe566f56a1.tar.bz2
gst-plugins-bad-5a48de94d77507db266e9e05242f93fe566f56a1.zip
[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
Diffstat (limited to 'gst/liveadder')
-rw-r--r--gst/liveadder/liveadder.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c
index fd452552..ac349b95 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.
*/