From 47b92480ffb2ea142bc5e40bff0a3cf228cc769f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 19 Feb 2019 11:06:02 +0100 Subject: [PATCH] Trying to fix nasty race condition SHUTDOWN->START_FILE that triggers a spurious MediaStopEvent --- platypush/plugins/media/mpv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/media/mpv.py b/platypush/plugins/media/mpv.py index b4252c72..1cb42cb5 100644 --- a/platypush/plugins/media/mpv.py +++ b/platypush/plugins/media/mpv.py @@ -80,6 +80,7 @@ class MediaMpvPlugin(MediaPlugin): bus = get_bus() if evt == Event.FILE_LOADED or evt == Event.START_FILE: playback_rebounce_event.set() + playback_rebounce_event.clear() self._mpv_stopped_event.clear() bus.post(NewPlayingMediaEvent(resource=self._get_current_resource())) bus.post(MediaPlayEvent(resource=self._get_current_resource())) @@ -88,7 +89,6 @@ class MediaMpvPlugin(MediaPlugin): elif evt == Event.UNPAUSE: bus.post(MediaPlayEvent(resource=self._get_current_resource())) elif evt == Event.END_FILE or evt == Event.SHUTDOWN: - playback_rebounce_event.clear() playback_rebounced = playback_rebounce_event.wait(timeout=1) if playback_rebounced: return