From d2ce799bfec5c19743692f0d87d84e53505e41f1 Mon Sep 17 00:00:00 2001 From: Peter Marheine Date: Thu, 15 Oct 2015 17:35:05 -0600 Subject: [PATCH] Immediately update local player state on server change If status replies are ignored, the result of a server play/pause command could be ignored as well (since the old playing status would end up being seen as a local restart), so set it immediately on dispatching the player command. --- syncplay/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syncplay/client.py b/syncplay/client.py index 7de9738..22da494 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -258,6 +258,10 @@ class SyncplayClient(object): def _serverUnpaused(self, setBy): hideFromOSD = not constants.SHOW_SAME_ROOM_OSD + # In high-player-latency situations we might report our state back to + # the server before any player status is accepted as fresh. Override + # the locally-stored playback state. + self._playerPaused = False self._playerCommand(self._player.setPaused, False) madeChangeOnPlayer = True self.ui.showMessage(getMessage("unpause-notification").format(setBy), hideFromOSD) @@ -265,6 +269,7 @@ class SyncplayClient(object): def _serverPaused(self, setBy): hideFromOSD = not constants.SHOW_SAME_ROOM_OSD + self._playerPaused = True if constants.SYNC_ON_PAUSE and self.getUsername() <> setBy: self.setPosition(self.getGlobalPosition()) self._playerCommand(self._player.setPaused, True)