Merge pull request #120 from wiiaboo/mpv_fix
Support mpv without length property
This commit is contained in:
commit
734efae775
@ -157,7 +157,7 @@ USERLIST_GUI_FILENAME_COLUMN = 3
|
|||||||
MPLAYER_SLAVE_ARGS = ['-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4', '-af-add', 'scaletempo']
|
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']
|
MPV_ARGS = ['--force-window', '--idle', '--hr-seek=always', '--keep-open']
|
||||||
MPV_SLAVE_ARGS = ['--msg-level=all=error,cplayer=info,term-msg=info', '--input-terminal=no', '--input-file=/dev/stdin']
|
MPV_SLAVE_ARGS = ['--msg-level=all=error,cplayer=info,term-msg=info', '--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_SLAVE_ARGS_NEW = ['--term-playing-msg=<SyncplayUpdateFile>\nANS_filename=${filename}\nANS_length=${=length:${=duration:0}}\nANS_path=${path}\n</SyncplayUpdateFile>', '--terminal=yes']
|
||||||
MPV_NEW_VERSION = False
|
MPV_NEW_VERSION = False
|
||||||
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',
|
||||||
'--play-and-pause', '--start-time=0']
|
'--play-and-pause', '--start-time=0']
|
||||||
|
|||||||
@ -7,7 +7,7 @@ from syncplay.utils import isURL
|
|||||||
import os, sys, time
|
import os, sys, time
|
||||||
|
|
||||||
class MpvPlayer(MplayerPlayer):
|
class MpvPlayer(MplayerPlayer):
|
||||||
RE_VERSION = re.compile('.*mpv (\d)\.(\d)\.\d.*')
|
RE_VERSION = re.compile('.*mpv (\d+)\.(\d+)\.\d+.*')
|
||||||
osdMessageSeparator = "\\n"
|
osdMessageSeparator = "\\n"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -120,9 +120,11 @@ class NewMpvPlayer(OldMpvPlayer):
|
|||||||
self.lastMPVPositionUpdate = time.time()
|
self.lastMPVPositionUpdate = time.time()
|
||||||
|
|
||||||
def _getProperty(self, property_):
|
def _getProperty(self, property_):
|
||||||
floatProperties = ['length','time-pos']
|
floatProperties = ['time-pos']
|
||||||
if property_ in floatProperties:
|
if property_ in floatProperties:
|
||||||
propertyID = u"={}".format(property_)
|
propertyID = u"={}".format(property_)
|
||||||
|
elif property_ == 'length':
|
||||||
|
propertyID = u'=length:${=duration:0}'
|
||||||
else:
|
else:
|
||||||
propertyID = property_
|
propertyID = property_
|
||||||
self._listener.sendLine(u"print_text ""ANS_{}=${{{}}}""".format(property_, propertyID))
|
self._listener.sendLine(u"print_text ""ANS_{}=${{{}}}""".format(property_, propertyID))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user