From be92ff8b6ddf50c9949d290d43d4dd8e3b19e4bf Mon Sep 17 00:00:00 2001 From: Borislav Draganov Date: Thu, 6 Aug 2020 15:12:49 +0300 Subject: [PATCH] Fixed MPC crashes when trying to open YouTube videos with emojis (#328) * Fixed crashes when trying to open YouTube videos with emojis --- syncplay/players/mpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncplay/players/mpc.py b/syncplay/players/mpc.py index 68f7e9b..d53645a 100755 --- a/syncplay/players/mpc.py +++ b/syncplay/players/mpc.py @@ -86,7 +86,7 @@ class MpcHcApi: _fields_ = [ ('nMsgPos', ctypes.c_int32), ('nDurationMS', ctypes.c_int32), - ('strMsg', ctypes.c_wchar * (len(message) + 1)) + ('strMsg', ctypes.c_wchar * (len(message.encode('utf-8')) + 1)) ] cmessage = __OSDDATASTRUCT() cmessage.nMsgPos = MsgPos