Skip to content

Commit

Permalink
#409: process sound in non-ui thread since gstreamer has its own thre…
Browse files Browse the repository at this point in the history
…ads, suspend/resume no longer does anything with sound

git-svn-id: https://xpra.org/svn/Xpra/trunk@4131 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 9, 2013
1 parent 7040ae2 commit 0dd55a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/xpra/client/gtk2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, ())
Expand Down
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 @@ -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():
Expand All @@ -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

Expand Down
16 changes: 4 additions & 12 deletions src/xpra/server/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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()


Expand Down

0 comments on commit 0dd55a3

Please sign in to comment.