Syncplay / syncplay

Client/server to synchronize media playback on mpv/VLC/MPC-HC/MPC-BE on many computers
http://syncplay.pl/
Apache License 2.0
2.1k stars 214 forks source link

Client doesn't detect File loaded when using Mpv with --msg-module flag #134

Closed Felhamed closed 7 years ago

Felhamed commented 7 years ago

Syncplay client version : 1.4.0 OS: 4.10.11-1-Arch Linux Syncplay Debug logs: https://pastebin.com/raw/Qn9gUA3e

Description: When using the flag --msg-module in mpv.conf the client isn't able to detect that a file has been loaded. Tested by commenting out msg-module flag and Syncplay works as expected.

 #msg-module                             # prepend module name to log messages
 msg-color                               # color log messages on terminal

Edit: This isn't really an issue but I did a bunch of troubleshooting since I wasn't able to load the file with my mpv.conf vs running it with no conf and narrowed down to this flag.

Et0h commented 7 years ago

Nice research. Does this resolve the issue satisfactorily?

+++ syncplay/players/mplayer.py
@@ -168,6 +168,8 @@
     def lineReceived(self, line):
         if line:
             self._client.ui.showDebugMessage("player << {}".format(line))
+            line = line.replace("   cplayer: ","")  # --msg-module workaround
+            line = line.replace("  term-msg: ", "")
         if "Failed to get value of property" in line or "=(unavailable)" in line or line == "ANS_filename=" or line == "ANS_length=" or line == "ANS_path=":
             if "filename" in line:
                 self._getFilename()
Felhamed commented 7 years ago

Confirmed that fix resolved it, works perfectly. Thanks

Et0h commented 7 years ago

Excellent. Thanks for your support in squashing this bug :)