From 63847c22eaf6652cad46d41e6af7f8e9de9cd5fe Mon Sep 17 00:00:00 2001 From: Et0h Date: Sat, 24 Dec 2016 10:41:37 +0000 Subject: [PATCH] Ignore erroneous VLC duplicate position responses caused by low VLC time accuracy on AVI and some MKV files --- syncplay/__init__.py | 2 +- syncplay/players/vlc.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/syncplay/__init__.py b/syncplay/__init__.py index d1a337626..132569213 100644 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,4 +1,4 @@ version = '1.4.0' milestone = 'Yoitsu' -release_number = '35' +release_number = '36' projectURL = 'http://syncplay.pl/' diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 59c95100e..b491c39a6 100644 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -215,9 +215,14 @@ def lineReceived(self, line): self._client.ui.showDebugMessage("Treating 'playing' response as 'paused' due to VLC EOF bug") self._pausedAsk.set() elif name == "position": + newPosition = float(value.replace(",", ".")) if (value != "no-input" and self._filechanged == False) else self._client.getGlobalPosition() + if newPosition == self._previousPosition and newPosition <> self._duration and not self._paused: + self._client.ui.showDebugMessage("Not considering position {} duplicate as new time because of VLC time precision bug".format(newPosition)) + self._positionAsk.set() + return self._previousPreviousPosition = self._previousPosition self._previousPosition = self._position - self._position = float(value.replace(",", ".")) if (value != "no-input" and self._filechanged == False) else self._client.getGlobalPosition() + self._position = newPosition if self._position < 0 and self._duration > 2147 and self._vlcVersion == "3.0.0": self.drop(getMessage("vlc-failed-versioncheck")) self._lastVLCPositionUpdate = time.time()