From aeb57da5f767eebabdee6631a6f1336363fdd8ae Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 23 Mar 2015 17:18:24 +0000 Subject: [PATCH] #400 / #669 allow us to turn off the new variable min queue code using XPRA_VARIABLE_MIN_QUEUE=0 git-svn-id: https://xpra.org/svn/Xpra/trunk@8827 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/sound/sink.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xpra/sound/sink.py b/src/xpra/sound/sink.py index 259b2d7dfa..1a8f5d3a16 100755 --- a/src/xpra/sound/sink.py +++ b/src/xpra/sound/sink.py @@ -48,6 +48,8 @@ QUEUE_MIN_TIME = get_queue_time(QUEUE_TIME//4//MS_TO_NS, "MIN") assert QUEUE_MIN_TIME<=QUEUE_TIME +VARIABLE_MIN_QUEUE = os.environ.get("XPRA_VARIABLE_MIN_QUEUE", "1")=="1" + GST_FORMAT_BUFFERS = 4 @@ -134,7 +136,7 @@ def queue_pushing(self, *args): def queue_running(self, *args): ltime = int(self.queue.get_property("current-level-time")/MS_TO_NS) log("sound sink queue running: level=%s", ltime) - if self.queue_state=="underrun": + if self.queue_state=="underrun" and VARIABLE_MIN_QUEUE: #lift min time restrictions: #gobject.timeout_add(400, self.queue.set_property, "min-threshold-time", 0) self.queue.set_property("min-threshold-time", 0) @@ -144,7 +146,7 @@ def queue_running(self, *args): def queue_underrun(self, *args): ltime = int(self.queue.get_property("current-level-time")/MS_TO_NS) log("sound sink queue underrun: level=%s", ltime) - if self.queue_state!="underrun": + if self.queue_state!="underrun" and VARIABLE_MIN_QUEUE: #lift min time restrictions: self.queue.set_property("min-threshold-time", QUEUE_MIN_TIME) self.queue_state = "underrun"