From 72ea605050351fe63f0d6b504566449c37efb0fc Mon Sep 17 00:00:00 2001 From: kelciour Date: Wed, 16 Sep 2020 09:25:18 +0300 Subject: [PATCH] Revert back to listening for idle callback https://forums.ankiweb.net/t/anki-2-1-33-linux-audio-stops-working/3023 --- qt/aqt/sound.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qt/aqt/sound.py b/qt/aqt/sound.py index fd0f9a130..08f5c206f 100644 --- a/qt/aqt/sound.py +++ b/qt/aqt/sound.py @@ -337,7 +337,8 @@ class MpvManager(MPV, SoundOrVideoPlayer): def on_init(self) -> None: # if mpv dies and is restarted, tell Anki the # current file is done - self.on_end_file() + if self._on_done: + self._on_done() try: self.command("keybind", "q", "stop") @@ -364,8 +365,8 @@ class MpvManager(MPV, SoundOrVideoPlayer): def seek_relative(self, secs: int) -> None: self.command("seek", secs, "relative") - def on_end_file(self) -> None: - if self._on_done: + def on_property_idle_active(self, value: bool) -> None: + if value and self._on_done: self._on_done() def shutdown(self) -> None: