Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions syncplay/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@
USERLIST_GUI_USERNAME_COLUMN = 0
USERLIST_GUI_FILENAME_COLUMN = 3

MPLAYER_SLAVE_ARGS = ['-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4', '-af', 'scaletempo']
# --quiet works with both mpv 0.2 and 0.3
MPV_SLAVE_ARGS = ['--force-window', '--idle', '--hr-seek=always', '--quiet', '--keep-open', '--af-add=scaletempo', '--input-terminal=no', '--input-file=/dev/stdin']
MPLAYER_SLAVE_ARGS = ['-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4', '-af-add', 'scaletempo']
MPV_ARGS = ['--force-window', '--idle', '--hr-seek=always', '--keep-open', '--af-add=scaletempo']
MPV_SLAVE_ARGS = ['--quiet', '--input-terminal=no', '--input-file=/dev/stdin']
MPV_SLAVE_ARGS_NEW = ['--term-playing-msg=<SyncplayUpdateFile>\nANS_filename=${filename}\nANS_length=${=length}\nANS_path=${path}\n</SyncplayUpdateFile>', '--terminal=yes']
MPV_NEW_VERSION = False
VLC_SLAVE_ARGS = ['--extraintf=luaintf', '--lua-intf=syncplay', '--no-quiet', '--no-input-fast-seek',
Expand Down
12 changes: 7 additions & 5 deletions syncplay/players/mplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ def getIconPath(path):
return constants.MPLAYER_ICONPATH

@staticmethod
def getStartupArgs(path):
return constants.MPLAYER_SLAVE_ARGS
def getStartupArgs(path, userArgs):
args = []
if userArgs:
args.extend(userArgs)
args.extend(constants.MPLAYER_SLAVE_ARGS)
return args

@staticmethod
def isValidPlayerPath(path):
Expand Down Expand Up @@ -270,9 +274,7 @@ def __init__(self, playerController, playerPath, filePath, args):
filePath = None
else:
call.extend([filePath])
if args:
call.extend(args)
call.extend(playerController.getStartupArgs(playerPath))
call.extend(playerController.getStartupArgs(playerPath, args))
# 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
Expand Down
7 changes: 5 additions & 2 deletions syncplay/players/mpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ def run(client, playerPath, filePath, args):
return OldMpvPlayer(client, MpvPlayer.getExpandedPath(playerPath), filePath, args)

@staticmethod
def getStartupArgs(path):
args = constants.MPV_SLAVE_ARGS
def getStartupArgs(path, userArgs):
args = constants.MPV_ARGS
if userArgs:
args.extend(userArgs)
args.extend(constants.MPV_SLAVE_ARGS)
if constants.MPV_NEW_VERSION:
args.extend(constants.MPV_SLAVE_ARGS_NEW)
return args
Expand Down