integrate _packagedCmd() into mpv for binary distrib

This commit is contained in:
Damien Elmes 2017-10-02 16:37:52 +10:00
parent d530134218
commit ca95552408
2 changed files with 8 additions and 1 deletions

View file

@ -64,6 +64,7 @@ class MPVBase:
"""
executable = find_executable("mpv")
popenEnv = None
default_argv = [
"--idle",
@ -106,7 +107,7 @@ class MPVBase:
def _start_process(self):
"""Start the mpv process.
"""
self._proc = subprocess.Popen(self.argv)
self._proc = subprocess.Popen(self.argv, env=self.popenEnv)
def _stop_process(self):
"""Stop the mpv process.

View file

@ -80,7 +80,13 @@ def retryWait(proc):
from anki.mpv import MPV
mpvPath, mpvEnv = _packagedCmd(["mpv"])
class MpvManager(MPV):
executable = mpvPath[0]
popenEnv = mpvEnv
def __init__(self):
super().__init__(window_id=None, debug=False)