[media.mpv] Make player.wait_for_shutdown call back-compatible.

Older versions of python-mpv don't support the timeout parameter.
This commit is contained in:
Fabio Manganiello 2024-10-21 23:44:49 +02:00
parent 2c05b7a225
commit c96e83107e
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -257,7 +257,12 @@ class MediaMpvPlugin(MediaPlugin):
player.stop() player.stop()
player.quit(code=0) player.quit(code=0)
player.wait_for_shutdown(timeout=10) try:
player.wait_for_shutdown(timeout=10)
except TypeError:
# Older versions of python-mpv don't support the timeout argument
player.wait_for_shutdown()
player.terminate() player.terminate()
self._player = None self._player = None
return self.status() return self.status()