Revert back to listening for idle callback

https://forums.ankiweb.net/t/anki-2-1-33-linux-audio-stops-working/3023
This commit is contained in:
kelciour 2020-09-16 09:25:18 +03:00
parent a8eba9d341
commit 72ea605050

View File

@ -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: