Few fixes for VLC playback

This commit is contained in:
Uriziel 2013-01-25 22:36:31 +01:00
parent 3845fd316b
commit 8750fd2a6c
2 changed files with 5 additions and 2 deletions

View File

@ -54,6 +54,7 @@ MPC_RETRY_WAIT_TIME = 0.01
MPC_MAX_RETRIES = 30
MPC_PAUSE_TOGGLE_DELAY = 0.05
VLC_OPEN_MAX_WAIT_TIME = 10
VLC_SOCKET_OPEN_WAIT_TIME = 0.5
#These are not changes you're looking for
MPLAYER_SLAVE_ARGS = [ '-slave', '-nomsgcolor', '-msglevel', 'all=1:global=4']

View File

@ -8,6 +8,7 @@ import random
import socket
import asynchat, asyncore
from syncplay.messages import getMessage
import time
class VlcPlayer(BasePlayer):
speedSupported = True
@ -106,13 +107,13 @@ class VlcPlayer(BasePlayer):
self._filepath = value
self._pathAsk.set()
elif(name == "duration" and (value != "no-input")):
self._duration = float(value)
self._duration = float(value.replace(",", "."))
self._durationAsk.set()
elif(name == "playstate"):
self._paused = bool(value != 'playing') if(value != "no-input") else self._client.getGlobalPaused()
self._pausedAsk.set()
elif(name == "position"):
self._position = float(value) if (value != "no-input") else self._client.getGlobalPosition()
self._position = float(value.replace(",", ".")) if (value != "no-input") else self._client.getGlobalPosition()
self._positionAsk.set()
elif(name == "filename"):
self._filename = value
@ -185,6 +186,7 @@ class VlcPlayer(BasePlayer):
def run(self):
self._vlcready.clear()
time.sleep(constants.VLC_SOCKET_OPEN_WAIT_TIME)
self.connect(('localhost', self.__playerController.vlcport))
asyncore.loop()