From 5dd7fc8c6e592b7bb02ca67fe5c39c5504c4c2bf Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 9 Apr 2019 15:32:44 +1000 Subject: [PATCH] another attempt to preventing mpv from accessing standard config https://github.com/dae/anki/pull/296 --- anki/sound.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/anki/sound.py b/anki/sound.py index 5b089b0ad..e4764b139 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -90,10 +90,6 @@ from anki.mpv import MPV, MPVBase mpvPath, mpvEnv = _packagedCmd(["mpv"]) -def setMpvConfigBase(base): - global mpvEnv - mpvEnv['XDG_CONFIG_HOME'] = base - class MpvManager(MPV): executable = mpvPath[0] @@ -125,6 +121,13 @@ class MpvManager(MPV): def on_idle(self): runHook("mpvIdleHook") +def setMpvConfigBase(base): + mpvConfPath = os.path.join(base, "mpv.conf") + MpvManager.default_argv += [ + "--no-config", + "--include="+mpvConfPath, + ] + mpvManager = None def setupMPV():