From 7834d6c743555065359651da7b75cde582bf2dd8 Mon Sep 17 00:00:00 2001 From: marcelveldt Date: Sun, 20 Oct 2019 00:16:53 +0200 Subject: [PATCH] Update http_streamer.py --- music_assistant/http_streamer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/music_assistant/http_streamer.py b/music_assistant/http_streamer.py index a5df76ef..bd496abd 100755 --- a/music_assistant/http_streamer.py +++ b/music_assistant/http_streamer.py @@ -148,7 +148,8 @@ class HTTPStreamer(): asyncio.run_coroutine_threadsafe( buffer.put(b''), self.mass.event_loop) # start fill buffer task in background - threading.Thread(target=fill_buffer).start() + fill_buffer_thread = threading.Thread(target=fill_buffer) + fill_buffer_thread.start() LOGGER.info("Start Queue Stream for player %s " %(player.name)) is_start = True @@ -278,6 +279,8 @@ class HTTPStreamer(): ### END OF QUEUE STREAM sox_proc.stdin.close() sox_proc.terminate() + fill_buffer_thread.join() + del sox_proc LOGGER.info("streaming of queue for player %s completed" % player.name) async def __get_audio_stream(self, player, queue_item, cancelled, -- 2.34.1