refactoring

This commit is contained in:
Uriziel 2012-10-17 06:59:12 +02:00
parent 8da1c00f07
commit c0579d5c54
1 changed files with 3 additions and 4 deletions

View File

@ -13,8 +13,7 @@ class MplayerPlayer(BasePlayer):
self._filename = None
self._filepath = None
_process = subprocess.Popen([playerPath, filePath, '-slave', '-msglevel', 'all=1:global=4'], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
self._listener = self.__Listener(self, _process)
self._listener = self.__Listener(self, playerPath, filePath)
self._listener.setDaemon(True)
self._listener.start()
@ -134,9 +133,9 @@ class MplayerPlayer(BasePlayer):
self._client.ui.showMessage(line, True, True)
class __Listener(threading.Thread):
def __init__(self, playerController, playerProcess):
def __init__(self, playerController, playerPath, filePath):
self.__playerController = playerController
self.__process = playerProcess
self.__process = subprocess.Popen([playerPath, filePath, '-slave', '-msglevel', 'all=1:global=4'], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
threading.Thread.__init__(self, name="MPlayer Listener")
def run(self):