From 32ea33aa379a24c9370ebdf747eba857160a2610 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 7 Apr 2015 16:33:50 +0000 Subject: [PATCH] when the sound process stops and fires the callback, make sure it is the current one before telling the server to stop (and avoid killing the new one if this is because of an overrun restart) git-svn-id: https://xpra.org/svn/Xpra/trunk@8955 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/client/ui_client_base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xpra/client/ui_client_base.py b/src/xpra/client/ui_client_base.py index 8470af1b74..00f03ce575 100644 --- a/src/xpra/client/ui_client_base.py +++ b/src/xpra/client/ui_client_base.py @@ -1644,8 +1644,10 @@ def sound_sink_error(self, sound_sink, error): soundlog.warn("stopping speaker because of error: %s", error) self.stop_receiving_sound() def sound_process_stopped(self, sound_sink, *args): - soundlog("the sound sink process has stopped (%s)", args) - self.stop_receiving_sound() + soundlog("the sound sink process %s has stopped, current sound sink=%s", sound_sink, self.sound_sink) + if not self.sink_restart_pending and sound_sink==self.sound_sink: + soundlog.warn("the sound process has stopped") + self.stop_receiving_sound() def sound_sink_overrun(self, *args): if self.sink_restart_pending: @@ -1659,11 +1661,11 @@ def sound_sink_overrun(self, *args): #Note: the next sound packet will take care of starting a new pipeline self.stop_receiving_sound() def restart(): + self.sink_restart_pending = False soundlog("restart() sound_sink=%s, codec=%s, server_sound_sequence=%s", self.sound_sink, codec, self.server_sound_sequence) if self.server_sound_sequence: self.send_new_sound_sequence() self.start_receiving_sound() - self.sink_restart_pending = False return False self.timeout_add(200, restart)