Skip to content

Commit

Permalink
#669:
Browse files Browse the repository at this point in the history
* when we stop the wrapper, we want to clean everything so call cleanup() which calls stop()
* prevent races in stop() which can also be called by the network thread..
* don't bother logging details of data we drop (and we do drop it now that we call cleanup during the wrapper exit)

git-svn-id: https://xpra.org/svn/Xpra/trunk@8905 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 3, 2015
1 parent d3866d3 commit baf8315
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/xpra/sound/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ def get_info(self):

def add_data(self, data, metadata=None):
#debug("sound sink: adding %s bytes to %s, metadata: %s, level=%s", len(data), self.src, metadata, int(self.queue.get_property("current-level-time")/MS_TO_NS))
log("add_data(%s bytes, %s) queue_state=%s, src=%s", len(data), metadata, self.queue_state, self.src)
if not self.src:
log("add_data(..) dropped")
return
log("add_data(%s bytes, %s) queue_state=%s, src=%s", len(data), metadata, self.queue_state, self.src)
if self.queue_state == "overrun":
clt = self.queue.get_property("current-level-time")
qpct = int(min(QUEUE_TIME, clt)*100.0/QUEUE_TIME)
Expand Down
6 changes: 4 additions & 2 deletions src/xpra/sound/sound_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ def start(self):
log("SoundPipeline.start() done")

def stop(self):
if not self.pipeline:
p = self.pipeline
self.pipeline = None
if not p:
return
log("SoundPipeline.stop()")
#uncomment this to see why we end up calling stop()
Expand All @@ -116,7 +118,7 @@ def stop(self):
# if v:
# log(v)
self.state = "stopped"
self.pipeline.set_state(gst.STATE_NULL)
p.set_state(gst.STATE_NULL)
self.volume = None
log("SoundPipeline.stop() done")

Expand Down
2 changes: 1 addition & 1 deletion src/xpra/sound/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def start(self):
def stop(self):
wo = self.wrapped_object
if wo:
wo.stop()
wo.cleanup()
self.wrapped_object = None
subprocess_callee.stop(self)

Expand Down

0 comments on commit baf8315

Please sign in to comment.