From 68231a645a69f434fb27a1e15e530696bdad7145 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 28 Jul 2011 11:44:20 +0200 Subject: [PATCH] baseaudiosink: fix max latency calculation ... to allow infinite max, as also claimed by comment. --- gst-libs/gst/audio/gstbaseaudiosink.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index ffe449872e..7e462f4272 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -443,12 +443,16 @@ gst_base_audio_sink_query (GstElement * element, GstQuery * query) min_latency = min_latency + min_l; /* the max latency is the max of the peer, we can delay an infinite * amount of time. */ - max_latency = min_latency + (max_l == -1 ? 0 : max_l); + max_latency = (max_l == -1) ? -1 : (min_latency + max_l); GST_DEBUG_OBJECT (basesink, "peer min %" GST_TIME_FORMAT ", our min latency: %" GST_TIME_FORMAT, GST_TIME_ARGS (min_l), GST_TIME_ARGS (min_latency)); + GST_DEBUG_OBJECT (basesink, + "peer max %" GST_TIME_FORMAT ", our max latency: %" + GST_TIME_FORMAT, GST_TIME_ARGS (max_l), + GST_TIME_ARGS (max_latency)); } else { GST_DEBUG_OBJECT (basesink, "peer or we are not live, don't care about latency");