From b87b0f0d6bc8b0c7c59a4e5e81443ac57d034d3f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 2 Nov 2017 12:49:06 +0000 Subject: [PATCH] underrun is an event, so don't use the timestamp if we are still in this state git-svn-id: https://xpra.org/svn/Xpra/trunk@17286 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/sound/sink.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xpra/sound/sink.py b/src/xpra/sound/sink.py index cc78ae92a2..1f45775223 100755 --- a/src/xpra/sound/sink.py +++ b/src/xpra/sound/sink.py @@ -256,9 +256,11 @@ def set_min_level(self): return try: cmtt = self.queue.get_property("min-threshold-time")//MS_TO_NS - #from 100% down to 0% in 2 seconds after underrun: - now = monotonic_time() - pct = max(0, int((self.last_underrun+2-now)*50)) + if self.queue_state=="underrun": + pct = 100 + else: + #from 100% down to 0% in 2 seconds after underrun: + pct = max(0, int((self.last_underrun+2-now)*50)) #cannot go higher than mst-50: mst = self.queue.get_property("max-size-time") mrange = max(lrange+100, 150)