summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2008-04-28 23:28:51 +0000
committerEdward Hervey <bilboed@bilboed.com>2009-02-17 19:29:04 +0100
commit2f5fd70ad8254712a3ae961d8c38a3365ed1d9e3 (patch)
treead3628936aa85e4d1304f61263bd74544efcbe72
parent89566bfc8aa8dbb699d35a784722b7f13f6c3e64 (diff)
downloadgst-plugins-bad-2f5fd70ad8254712a3ae961d8c38a3365ed1d9e3.tar.gz
gst-plugins-bad-2f5fd70ad8254712a3ae961d8c38a3365ed1d9e3.tar.bz2
gst-plugins-bad-2f5fd70ad8254712a3ae961d8c38a3365ed1d9e3.zip
[MOVED FROM GST-P-FARSIGHT] Max latency should also be increased by our own latency
20080428232851-4f0f6-05f9a89403cd54211f2f4a6595704270eab9616f.gz
-rw-r--r--gst/liveadder/liveadder.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c
index 54a7f475..5ab45655 100644
--- a/gst/liveadder/liveadder.c
+++ b/gst/liveadder/liveadder.c
@@ -645,13 +645,17 @@ gst_live_adder_query (GstPad * pad, GstQuery * query)
gst_iterator_free (iter);
if (res) {
-
+ GstClockTime my_latency = adder->latency_ms * GST_MSECOND;
GST_OBJECT_LOCK (adder);
adder->peer_latency = min_latency;
- min_latency += adder->latency_ms * GST_MSECOND;
+ min_latency += my_latency;
GST_OBJECT_UNLOCK (adder);
- max_latency = MAX (max_latency, min_latency);
+ /* Make sure we don't risk an overflow */
+ if (max_latency < G_MAXUINT64 - my_latency)
+ max_latency += my_latency;
+ else
+ max_latency = G_MAXUINT64
gst_query_set_latency (query, TRUE, min_latency, max_latency);
GST_DEBUG_OBJECT (adder, "Calculated total latency : min %"
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,