From c96e83107e720876cc4a74077f3635f2cbc58611 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 21 Oct 2024 23:44:49 +0200 Subject: [PATCH] [media.mpv] Make `player.wait_for_shutdown` call back-compatible. Older versions of python-mpv don't support the timeout parameter. --- platypush/plugins/media/mpv/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/media/mpv/__init__.py b/platypush/plugins/media/mpv/__init__.py index 93bd19623a..b1b2317dc9 100644 --- a/platypush/plugins/media/mpv/__init__.py +++ b/platypush/plugins/media/mpv/__init__.py @@ -257,7 +257,12 @@ class MediaMpvPlugin(MediaPlugin): player.stop() 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() self._player = None return self.status()