From fe224c031600934d1719a99fc8140d9169ed8835 Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Fri, 27 Apr 2018 00:19:05 +0200 Subject: [PATCH] Fixes mpv support --- syncplay/players/mplayer.py | 4 ++-- syncplay/players/mpv.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syncplay/players/mplayer.py b/syncplay/players/mplayer.py index f0b0404..5e85b67 100755 --- a/syncplay/players/mplayer.py +++ b/syncplay/players/mplayer.py @@ -324,9 +324,9 @@ class MplayerPlayer(BasePlayer): if 'TERM' in env: del env['TERM'] if filePath: - self.__process = subprocess.Popen(call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.__getCwd(filePath, env), env=env) + self.__process = subprocess.Popen(call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.__getCwd(filePath, env), env=env, bufsize=0) else: - self.__process = subprocess.Popen(call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) + self.__process = subprocess.Popen(call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, env=env, bufsize=0) threading.Thread.__init__(self, name="MPlayer Listener") diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index dbe01e9..26da661 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -267,7 +267,7 @@ class NewMpvPlayer(OldMpvPlayer): self.mpvErrorCheck(line) if "" in line: - line = line.decode("utf-8").replace(constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER, "\\").encode("utf-8") + line = line.replace(constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER, "\\") self._listener.sendChat(line[6:-7]) if "" in line: