Skip to content

Commit

Permalink
#986 include sound sequence in stop requests to make sure we only sto…
Browse files Browse the repository at this point in the history
…p the right one (in case of restarts)

git-svn-id: https://xpra.org/svn/Xpra/trunk@11474 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 23, 2015
1 parent a603aea commit 7137010
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ def stop_receiving_sound(self, tell_server=True):
ss = self.sound_sink
self.speaker_enabled = False
if tell_server:
self.send("sound-control", "stop")
self.send("sound-control", "stop", self.min_sound_sequence)
self.min_sound_sequence += 1
self.send("sound-control", "new-sequence", self.min_sound_sequence)
if ss is None:
Expand Down
6 changes: 6 additions & 0 deletions src/xpra/server/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,12 @@ def stop_receiving_sound(self):
def sound_control(self, action, *args):
soundlog("sound_control(%s, %s)", action, args)
if action=="stop":
if len(args)>0:
sequence = int(args[0])
if sequence!=self.sound_source_sequence:
log.warn("sound sequence mismatch: %i vs %i", sequence, self.sound_source_sequence)
return "not stopped"
soundlog("stop: sequence number matches")
self.stop_sending_sound()
return "stopped"
elif action in ("start", "fadein"):
Expand Down

0 comments on commit 7137010

Please sign in to comment.