Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* queue events should update the queue state not the global state, as the "starting" state is also used to ignore some underrun and overrun events
* remove unused underrun_events list

git-svn-id: https://xpra.org/svn/Xpra/trunk@12526 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 4, 2016
1 parent 73dc3f4 commit fcb00b7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/xpra/sound/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def __init__(self, sink_type=None, sink_options={}, codecs=get_codecs(), codec_o
self.overruns = 0
self.underruns = 0
self.overrun_events = deque(maxlen=100)
self.underrun_events = deque(maxlen=100)
self.queue_state = "starting"
self.last_underrun = 0
self.last_overrun = 0
Expand Down Expand Up @@ -152,12 +151,12 @@ def cleanup(self):


def queue_pushing(self, *args):
self.update_state("pushing")
self.queue_state = "pushing"
self.emit_info()
return True

def queue_running(self, *args):
self.update_state("running")
self.queue_state = "running"
self.set_min_level()
self.set_max_level()
self.emit_info()
Expand All @@ -168,11 +167,10 @@ def queue_underrun(self, *args):
if self.queue_state=="starting" or 1000*(now-self.start_time)<GRACE_PERIOD:
gstlog("ignoring underrun during startup")
return 1
self.update_state("underrun")
self.queue_state = "underrun"
if now-self.last_underrun>2:
self.last_underrun = now
self.set_min_level()
self.underrun_events.append(now)
self.emit_info()
return 1

Expand Down

0 comments on commit fcb00b7

Please sign in to comment.