forked from platypush/platypush
[media.vlc] Fixed a non-easily reproducible deadlock.
The VLC event callback handler shouldn't try and access the media and/or the MRL while processing a `MediaPlayerTitleChanged` event. It seems that in some particular streaming cases (mostly reproducible with Jellyfin media URLs) this may result in deadlocks - probably because the media metadata is being handled within the HTTP request, and the callback handler runs within the same context.
This commit is contained in:
parent
8fa2080652
commit
89bcdbe1ac
1 changed files with 8 additions and 1 deletions
|
@ -205,7 +205,14 @@ class MediaVlcPlugin(MediaPlugin):
|
|||
self.logger.debug('Received VLC event: %s', event.type)
|
||||
playing_url = None
|
||||
|
||||
if self._player:
|
||||
if (
|
||||
self._player
|
||||
and
|
||||
# Avoid a weird deadlock when trying to get the media URL and
|
||||
# we are processing a MediaPlayerTitleChanged event (probably
|
||||
# because the media metadata is being updated)
|
||||
event.type != EventType.MediaPlayerTitleChanged # type: ignore
|
||||
):
|
||||
media = self._player.get_media()
|
||||
playing_url = media.get_mrl() if media else None
|
||||
|
||||
|
|
Loading…
Reference in a new issue