Fixed linux PATH bug. Refactoring for mpv support.
This commit is contained in:
parent
eb27fe2c6a
commit
e61cddacbe
@ -9,6 +9,7 @@ import os
|
|||||||
class MplayerPlayer(BasePlayer):
|
class MplayerPlayer(BasePlayer):
|
||||||
speedSupported = True
|
speedSupported = True
|
||||||
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
|
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
|
||||||
|
SLAVE_ARGS = constants.MPLAYER_SLAVE_ARGS
|
||||||
def __init__(self, client, playerPath, filePath, args):
|
def __init__(self, client, playerPath, filePath, args):
|
||||||
self._client = client
|
self._client = client
|
||||||
self._paused = None
|
self._paused = None
|
||||||
@ -145,11 +146,11 @@ class MplayerPlayer(BasePlayer):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getExpandedPath(path):
|
def getExpandedPath(playerPath):
|
||||||
if os.access(path, os.X_OK):
|
if os.access(playerPath, os.X_OK):
|
||||||
return path
|
return playerPath
|
||||||
for path in os.environ['PATH'].split(':'):
|
for path in os.environ['PATH'].split(':'):
|
||||||
path = os.path.join(os.path.realpath(path), path)
|
path = os.path.join(os.path.realpath(path), playerPath)
|
||||||
if os.access(path, os.X_OK):
|
if os.access(path, os.X_OK):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
@ -170,7 +171,7 @@ class MplayerPlayer(BasePlayer):
|
|||||||
if(not filePath):
|
if(not filePath):
|
||||||
raise ValueError
|
raise ValueError
|
||||||
call = [playerPath, filePath]
|
call = [playerPath, filePath]
|
||||||
call.extend(constants.MPLAYER_SLAVE_ARGS)
|
call.extend(playerController.SLAVE_ARGS)
|
||||||
if(args):
|
if(args):
|
||||||
call.extend(args)
|
call.extend(args)
|
||||||
self.__process = subprocess.Popen(call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
|
self.__process = subprocess.Popen(call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user