Skip to content

Commit

Permalink
Ignore erroneous VLC duplicate position responses caused by low VLC t…
Browse files Browse the repository at this point in the history
…ime accuracy on AVI and some MKV files
  • Loading branch information
Et0h committed Dec 24, 2016
1 parent d0e93ca commit 63847c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion syncplay/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = '1.4.0'
milestone = 'Yoitsu'
release_number = '35'
release_number = '36'
projectURL = 'http://syncplay.pl/'
7 changes: 6 additions & 1 deletion syncplay/players/vlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 63847c2

Please sign in to comment.