Fixed a bug that could deadlock the player

This commit is contained in:
Christoph Stahl 2024-11-15 22:20:49 +01:00
parent 02e77662ac
commit a99679eda5
2 changed files with 3 additions and 0 deletions

View file

@ -154,6 +154,7 @@ class Source(ABC):
"mpv",
*args,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
return await mpv_process
@ -306,6 +307,7 @@ class Source(ABC):
self.downloaded_files[entry.ident].audio,
*extra_options,
)
await self.player.communicate()
await self.player.wait()
self.player = None
if self._skip_next:

View file

@ -257,6 +257,7 @@ class YoutubeSource(Source):
"--fullscreen",
mpv_options,
)
await self.player.communicate()
await self.player.wait()
else:
await super().play(entry, mpv_options)