Skip to content

Commit

Permalink
underrun is an event, so don't use the timestamp if we are still in t…
Browse files Browse the repository at this point in the history
…his state

git-svn-id: https://xpra.org/svn/Xpra/trunk@17286 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 2, 2017
1 parent f1ae321 commit b87b0f0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/xpra/sound/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b87b0f0

Please sign in to comment.