media.vlc.stop should be synchronized on the _stop_lock and should call _reset_state instead of simply setting self._player = None

This commit is contained in:
Fabio Manganiello 2021-03-16 19:42:59 +01:00
parent ce0ca2e9ee
commit f92d19a24e
1 changed files with 6 additions and 5 deletions

View File

@ -217,12 +217,13 @@ class MediaVlcPlugin(MediaPlugin):
@action @action
def quit(self): def quit(self):
""" Quit the player (same as `stop`) """ """ Quit the player (same as `stop`) """
if not self._player: with self._stop_lock:
return None, 'No vlc instance is running' if not self._player:
return None, 'No vlc instance is running'
self._player.stop() self._player.stop()
self._player = None self._reset_state()
return self.status() return self.status()
@action @action
def stop(self): def stop(self):