restore mpv/mplayer missing warning that got lost in the av changes

and ensure the UI doesn't get temporarily stuck after the command fails
This commit is contained in:
Damien Elmes 2020-02-29 21:05:37 +10:00
parent b2697122cd
commit 52f4f832ff
2 changed files with 9 additions and 8 deletions

View file

@ -82,12 +82,6 @@ your system's temporary folder may be incorrect."""
)
if "Pyaudio not" in error:
return showWarning(_("Please install PyAudio"))
if "install mplayer" in error:
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(
_(

View file

@ -1,6 +1,5 @@
# Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import atexit
import os
import re
@ -25,7 +24,7 @@ from aqt import gui_hooks
from aqt.mpv import MPV, MPVBase
from aqt.qt import *
from aqt.taskman import TaskManager
from aqt.utils import restoreGeom, saveGeom, startup_info
from aqt.utils import restoreGeom, saveGeom, showWarning, startup_info
# AV player protocol
##########################################################################
@ -291,6 +290,14 @@ class SimpleProcessPlayer(Player): # pylint: disable=abstract-method
except PlayerInterrupted:
# don't fire done callback when interrupted
return
except FileNotFoundError:
showWarning(
_(
"Sound and video on cards will not function until mpv or mplayer is installed."
)
)
# must call cb() here, as we don't currently have another way
# to flag to av_player that we've stopped
cb()