Merge pull request #32 from ion1/master
Fix compatibility with the 0.3.x mpv release
This commit is contained in:
commit
af5bba6cf2
@ -72,7 +72,8 @@ VLC_MAX_PORT = 55000
|
|||||||
|
|
||||||
#These are not changes you're looking for
|
#These are not changes you're looking for
|
||||||
MPLAYER_SLAVE_ARGS = [ '-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4']
|
MPLAYER_SLAVE_ARGS = [ '-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4']
|
||||||
MPV_SLAVE_ARGS = [ '--slave-broken', '--hr-seek=always', '-msglevel', 'all=1:global=4']
|
# --quiet works with both mpv 0.2 and 0.3
|
||||||
|
MPV_SLAVE_ARGS = ['--slave-broken', '--hr-seek=always', '--no-msgcolor', '--quiet']
|
||||||
VLC_SLAVE_ARGS = ['--extraintf=luaintf','--lua-intf=syncplay','--no-quiet','--no-input-fast-seek']
|
VLC_SLAVE_ARGS = ['--extraintf=luaintf','--lua-intf=syncplay','--no-quiet','--no-input-fast-seek']
|
||||||
VLC_SLAVE_NONOSX_ARGS = ['--no-one-instance','--no-one-instance-when-started-from-file']
|
VLC_SLAVE_NONOSX_ARGS = ['--no-one-instance','--no-one-instance-when-started-from-file']
|
||||||
MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_]+)=(.+)$"
|
MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_]+)=(.+)$"
|
||||||
|
|||||||
@ -206,7 +206,14 @@ class MplayerPlayer(BasePlayer):
|
|||||||
call.extend(playerController.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, cwd = os.path.dirname(playerPath))
|
# At least mpv may output escape sequences which result in syncplay
|
||||||
|
# trying to parse something like
|
||||||
|
# "\x1b[?1l\x1b>ANS_filename=blah.mkv". Work around this by
|
||||||
|
# unsetting TERM.
|
||||||
|
env = os.environ.copy()
|
||||||
|
if 'TERM' in env:
|
||||||
|
del env['TERM']
|
||||||
|
self.__process = subprocess.Popen(call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE, cwd=os.path.dirname(playerPath), env=env)
|
||||||
threading.Thread.__init__(self, name="MPlayer Listener")
|
threading.Thread.__init__(self, name="MPlayer Listener")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user