Merge pull request #761 from kelciour/linux-audio-stops-working

Revert mpv back to listening for idle callback
This commit is contained in:
Damien Elmes 2020-09-17 14:15:11 +10:00 committed by GitHub
commit dd835e692d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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: