Skip to content

Commit

Permalink
#400 / #669 allow us to turn off the new variable min queue code usin…
Browse files Browse the repository at this point in the history
…g XPRA_VARIABLE_MIN_QUEUE=0

git-svn-id: https://xpra.org/svn/Xpra/trunk@8827 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 23, 2015
1 parent 9f362c3 commit aeb57da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/xpra/sound/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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"
Expand Down

0 comments on commit aeb57da

Please sign in to comment.