From d8d6430ec7296f9163575d41a47efd44f94280d9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 5 Oct 2017 17:24:55 +1000 Subject: [PATCH] fall back to mplayer if mpv not found or too old ubuntu 14.04 looks to be using an ancient mpv version --- aqt/errors.py | 2 +- aqt/main.py | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/aqt/errors.py b/aqt/errors.py index fe9a70ba7..4f325d8b6 100644 --- a/aqt/errors.py +++ b/aqt/errors.py @@ -72,7 +72,7 @@ Anki manual for more information.""") if "Pyaudio not" in error: return showWarning(_("Please install PyAudio")) if "install mplayer" in error: - return showWarning(_("Please install mplayer")) + return showWarning(_("Sound and video on cards will not function until mpv or mplayer is installed.")) if "no default input" in error.lower(): return showWarning(_("Please connect a microphone, and ensure " "other programs are not using the audio device.")) diff --git a/aqt/main.py b/aqt/main.py index 59f39a235..386f52a0a 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -309,15 +309,9 @@ close the profile or restart Anki.""")) try: anki.sound.setupMPV() except FileNotFoundError: - showWarning(_("mpv is not installed - audio and video on cards will not work.")) - self.disableSound() + print("mpv not found, reverting to mplayer") except anki.mpv.MPVProcessError: - showWarning(_("mpv failed to start - please ensure it is version 0.17 or later.")) - self.disableSound() - - def disableSound(self): - anki.sound._player = lambda file: 1 - anki.sound._queueEraser = lambda: 1 + print("mpv too old, reverting to mplayer") # Collection load/unload ##########################################################################