From 0dd55a32e838977d61935e145d1ebbb8cbf4b504 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 9 Aug 2013 13:35:26 +0000 Subject: [PATCH] #409: process sound in non-ui thread since gstreamer has its own threads, suspend/resume no longer does anything with sound git-svn-id: https://xpra.org/svn/Xpra/trunk@4131 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/client/gtk2/client.py | 1 - src/xpra/client/ui_client_base.py | 2 +- src/xpra/server/source.py | 16 ++++------------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/xpra/client/gtk2/client.py b/src/xpra/client/gtk2/client.py index b203f19689..bdfc00927f 100644 --- a/src/xpra/client/gtk2/client.py +++ b/src/xpra/client/gtk2/client.py @@ -245,7 +245,6 @@ def poll_UI_loop(*args): if not self.UI_blocked_sent: log.info("UI thread is blocked, pausing server") self.send("suspend", True, self._id_to_window.keys()) - self.bump_sound_sequence() self.UI_blocked_sent = True time.sleep(1.0) thread.start_new_thread(poll_UI_loop, ()) diff --git a/src/xpra/client/ui_client_base.py b/src/xpra/client/ui_client_base.py index c1306b8fec..c4119203ec 100644 --- a/src/xpra/client/ui_client_base.py +++ b/src/xpra/client/ui_client_base.py @@ -1398,7 +1398,6 @@ def init_packet_handlers(self): "lost-window": self._process_lost_window, "desktop_size": self._process_desktop_size, "window-icon": self._process_window_icon, - "sound-data": self._process_sound_data, "draw": self._process_draw, # "clipboard-*" packets are handled by a special case below. }.items(): @@ -1408,6 +1407,7 @@ def init_packet_handlers(self): "ping": self._process_ping, "ping_echo": self._process_ping_echo, "info-response": self._process_info_response, + "sound-data": self._process_sound_data, }.items(): self._packet_handlers[k] = v diff --git a/src/xpra/server/source.py b/src/xpra/server/source.py index df0334fe48..572b01dc9c 100644 --- a/src/xpra/server/source.py +++ b/src/xpra/server/source.py @@ -223,7 +223,6 @@ def __init__(self, protocol, disconnect_cb, idle_add, timeout_add, source_remove self.window_sources = {} #WindowSource for each Window ID self.suspended = False - self.resume_sound = False self.uuid = "" self.hostname = "" @@ -373,31 +372,24 @@ def close(self): self.protocol = None def suspend(self, ui, wd): - log.debug("suspend(%s, %s) suspended=%s, resume_sound=%s, sound_source=%s", - ui, wd, self.suspended, self.resume_sound, self.sound_source) + log.debug("suspend(%s, %s) suspended=%s, sound_source=%s", + ui, wd, self.suspended, self.sound_source) if ui: self.suspended = True - if self.sound_source is None: - self.resume_sound = False - else: - self.resume_sound = self.sound_source.codec - self.stop_sending_sound() for wid in wd.keys(): ws = self.window_sources.get(wid) if ws: ws.suspend() def resume(self, ui, wd): - log.debug("resume(%s, %s) suspended=%s, resume_sound=%s, sound_source=%s", - ui, wd, self.suspended, self.resume_sound, self.sound_source) + log.debug("resume(%s, %s) suspended=%s, sound_source=%s", + ui, wd, self.suspended, self.sound_source) if ui: self.suspended = False for wid, window in wd.items(): ws = self.window_sources.get(wid) if ws: ws.resume(window) - if self.resume_sound: - self.start_sending_sound(self.resume_sound) self.do_send_cursor()