final (temporary) fix for kodi/vlc players for now
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 29 Jul 2022 13:36:18 +0000 (15:36 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 29 Jul 2022 13:36:18 +0000 (15:36 +0200)
music_assistant/controllers/streams.py

index 3ed542fc0217cd7da14fde81eb49e763c2630d07..5fba3b0c5cbeeb61dbc0a60e8aa2fcfe189b7e00 100644 (file)
@@ -192,7 +192,7 @@ class StreamsController:
             client_id += uuid4().hex
         elif (
             queue_stream.all_clients_connected.is_set()
-            and queue_stream.total_seconds_streamed
+            and queue_stream.queue.player.elapsed_time > 2
         ):
             self.logger.debug(
                 "Got stream request for running stream: %s, assuming next", stream_id
@@ -478,9 +478,6 @@ class QueueStream:
                 self.done.set()
                 return
             self.logger.debug("%s clients connected", len(self.connected_clients))
-            # TEMP fix - to remove in stream refactor
-            # some clients connect twice (browser, vlc, kodi) and we are not prepared for that
-            await asyncio.sleep(0.2)
             self.streaming_started = time()
 
             # Read bytes from final output and send chunk to child callback.