diff --git a/syncplay/players/ipc_iina.py b/syncplay/players/ipc_iina.py index 55a9f85..a91e8ff 100755 --- a/syncplay/players/ipc_iina.py +++ b/syncplay/players/ipc_iina.py @@ -25,8 +25,8 @@ class IINAProcess(MPVProcess): Manages an IINA process, ensuring the socket or pipe is available. (Internal) """ - def _start_process(self, ipc_socket, args): - self.process = subprocess.Popen(args) + def _start_process(self, ipc_socket, args, env): + self.process = subprocess.Popen(args, env=env) ipc_exists = False for _ in range(100): # Give IINA 10 seconds to start. time.sleep(0.1) diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 20820c2..cebc63d 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -603,7 +603,7 @@ class MpvPlayer(BasePlayer): env['PYTHONPATH'] = pythonPath try: socket = self.mpv_arguments.get('input-ipc-server') - self.mpvpipe = self.playerIPCHandler(mpv_location=self.playerPath, ipc_socket=socket, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, **self.mpv_arguments) + self.mpvpipe = self.playerIPCHandler(mpv_location=self.playerPath, ipc_socket=socket, loglevel="info", log_handler=self.__playerController.mpv_log_handler, quit_callback=self.stop_client, env=env, **self.mpv_arguments) except Exception as e: self.quitReason = getMessage("media-player-error").format(str(e)) + " " + getMessage("mpv-failed-advice") self.__playerController.reactor.callFromThread(self.__playerController._client.ui.showErrorMessage, self.quitReason, True) diff --git a/syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py b/syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py index ddfe83b..64b3dc2 100644 --- a/syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py +++ b/syncplay/players/python_mpv_jsonipc/python_mpv_jsonipc.py @@ -182,7 +182,7 @@ class MPVProcess: """ Manages an MPV process, ensuring the socket or pipe is available. (Internal) """ - def __init__(self, ipc_socket, mpv_location=None, **kwargs): + def __init__(self, ipc_socket, mpv_location=None, env=None, **kwargs): """ Create and start the MPV process. Will block until socket/pipe is available. @@ -208,9 +208,9 @@ class MPVProcess: self.ipc_socket = ipc_socket args = self._get_arglist(mpv_location, **kwargs) - self._start_process(ipc_socket, args) + self._start_process(ipc_socket, args, env=env) - def _start_process(self, ipc_socket, args): + def _start_process(self, ipc_socket, args, env): self.process = subprocess.Popen(args) ipc_exists = False for _ in range(100): # Give MPV 10 seconds to start.