mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
fall back to mplayer if mpv not found or too old
ubuntu 14.04 looks to be using an ancient mpv version
This commit is contained in:
parent
33c5b5f9e7
commit
d8d6430ec7
2 changed files with 3 additions and 9 deletions
|
@ -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."))
|
||||
|
|
10
aqt/main.py
10
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
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in a new issue