Trying to fix nasty race condition SHUTDOWN->START_FILE that triggers a spurious MediaStopEvent
This commit is contained in:
parent
c0513cade9
commit
47b92480ff
1 changed files with 1 additions and 1 deletions
|
@ -80,6 +80,7 @@ class MediaMpvPlugin(MediaPlugin):
|
||||||
bus = get_bus()
|
bus = get_bus()
|
||||||
if evt == Event.FILE_LOADED or evt == Event.START_FILE:
|
if evt == Event.FILE_LOADED or evt == Event.START_FILE:
|
||||||
playback_rebounce_event.set()
|
playback_rebounce_event.set()
|
||||||
|
playback_rebounce_event.clear()
|
||||||
self._mpv_stopped_event.clear()
|
self._mpv_stopped_event.clear()
|
||||||
bus.post(NewPlayingMediaEvent(resource=self._get_current_resource()))
|
bus.post(NewPlayingMediaEvent(resource=self._get_current_resource()))
|
||||||
bus.post(MediaPlayEvent(resource=self._get_current_resource()))
|
bus.post(MediaPlayEvent(resource=self._get_current_resource()))
|
||||||
|
@ -88,7 +89,6 @@ class MediaMpvPlugin(MediaPlugin):
|
||||||
elif evt == Event.UNPAUSE:
|
elif evt == Event.UNPAUSE:
|
||||||
bus.post(MediaPlayEvent(resource=self._get_current_resource()))
|
bus.post(MediaPlayEvent(resource=self._get_current_resource()))
|
||||||
elif evt == Event.END_FILE or evt == Event.SHUTDOWN:
|
elif evt == Event.END_FILE or evt == Event.SHUTDOWN:
|
||||||
playback_rebounce_event.clear()
|
|
||||||
playback_rebounced = playback_rebounce_event.wait(timeout=1)
|
playback_rebounced = playback_rebounce_event.wait(timeout=1)
|
||||||
if playback_rebounced:
|
if playback_rebounced:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue