Fixed mpv handling utf-8 filenames
This commit is contained in:
parent
af5bba6cf2
commit
f3d1d76942
@ -83,7 +83,7 @@ class MplayerPlayer(BasePlayer):
|
|||||||
self._setProperty('speed', "{:.2f}".format(value))
|
self._setProperty('speed', "{:.2f}".format(value))
|
||||||
|
|
||||||
def openFile(self, filePath):
|
def openFile(self, filePath):
|
||||||
self._listener.sendLine('loadfile {}'.format(self._quoteArg(filePath)))
|
self._listener.sendLine(u'loadfile {}'.format(self._quoteArg(filePath)))
|
||||||
self._onFileUpdate()
|
self._onFileUpdate()
|
||||||
if self._client.getGlobalPaused():
|
if self._client.getGlobalPaused():
|
||||||
self._listener.sendLine('pause')
|
self._listener.sendLine('pause')
|
||||||
@ -116,7 +116,7 @@ class MplayerPlayer(BasePlayer):
|
|||||||
arg = arg.replace('\\', '\\\\')
|
arg = arg.replace('\\', '\\\\')
|
||||||
arg = arg.replace("'", "\\'")
|
arg = arg.replace("'", "\\'")
|
||||||
arg = arg.replace('"', '\\"')
|
arg = arg.replace('"', '\\"')
|
||||||
return '"{}"'.format(arg)
|
return u'"{}"'.format(arg)
|
||||||
|
|
||||||
def lineReceived(self, line):
|
def lineReceived(self, line):
|
||||||
match = self.RE_ANSWER.match(line)
|
match = self.RE_ANSWER.match(line)
|
||||||
@ -231,6 +231,7 @@ class MplayerPlayer(BasePlayer):
|
|||||||
|
|
||||||
def sendLine(self, line):
|
def sendLine(self, line):
|
||||||
try:
|
try:
|
||||||
self.__process.stdin.write(line + "\n")
|
line = (line + "\n").encode('utf8')
|
||||||
|
self.__process.stdin.write(line)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user