Fixed episode changing bug in mpc
This commit is contained in:
parent
ed9f0462ac
commit
957f5498a4
@ -103,19 +103,19 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
def __getPosition(self):
|
def __getPosition(self):
|
||||||
self.__positionUpdate.clear()
|
self.__positionUpdate.clear()
|
||||||
self._mpcApi.askForCurrentPosition()
|
self._mpcApi.askForCurrentPosition()
|
||||||
self.__positionUpdate.wait()
|
self.__positionUpdate.wait(0.2)
|
||||||
return self._mpcApi.lastFilePosition
|
return self._mpcApi.lastFilePosition
|
||||||
|
|
||||||
def askForStatus(self):
|
def askForStatus(self):
|
||||||
try:
|
try:
|
||||||
if(self.__preventAsking.wait(0)):
|
if(self.__preventAsking.wait(0)):
|
||||||
position = self.__getPosition()
|
position = self.__getPosition()
|
||||||
paused = self._mpcApi.isPaused()
|
paused = self._mpcApi.isPaused()
|
||||||
position = float(position)
|
position = float(position)
|
||||||
if(self.__fileUpdate.acquire(0)):
|
if(self.__fileUpdate.acquire(0)):
|
||||||
self.__client.updatePlayerStatus(paused, position)
|
self.__client.updatePlayerStatus(paused, position)
|
||||||
self.__fileUpdate.release()
|
self.__fileUpdate.release()
|
||||||
return
|
return
|
||||||
self.__echoGlobalStatus()
|
self.__echoGlobalStatus()
|
||||||
except MpcHcApi.PlayerNotReadyException:
|
except MpcHcApi.PlayerNotReadyException:
|
||||||
self.askForStatus()
|
self.askForStatus()
|
||||||
@ -125,7 +125,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
|
|
||||||
def __forcePause(self, paused):
|
def __forcePause(self, paused):
|
||||||
i = 0
|
i = 0
|
||||||
while(paused <> self._mpcApi.isPaused() and i < 15):
|
while(paused <> self._mpcApi.isPaused() and i < 35):
|
||||||
i += 1
|
i += 1
|
||||||
self.setPaused(paused)
|
self.setPaused(paused)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user