Update http_streamer.py
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 8 Jun 2019 14:39:07 +0000 (16:39 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 8 Jun 2019 14:39:07 +0000 (16:39 +0200)
fix typo

music_assistant/modules/http_streamer.py

index 5009ed2a60efd21450644666513d3b1afe501d13..0811ae9a9d40f7df4c0630c07eed1dff5b96e8c2 100755 (executable)
@@ -258,15 +258,15 @@ class HTTPStreamer():
                 # and it helps a bit in the quest to follow where we are in the queue
                 while buffer.qsize() > 1 and not cancelled.is_set():
                     await asyncio.sleep(1)
-                # break out the loop if the http session is cancelled
-                if cancelled.is_set():
-                    break
                 if cur_chunk == 1:
                     # report start stream of current queue index
                     self.mass.event_loop.create_task(self.mass.player.player_queue_stream_move(player_id, queue_index))
             # end of the track reached
             LOGGER.info("Finished Streaming queue track: %s - %s" % (track_id, queue_track.name))
             queue_index += 1
+            # break out the loop if the http session is cancelled
+            if cancelled.is_set():
+                break
         
         # end of queue reached, pass last fadeout bits to final output
         if last_fadeout_data: