Increase chunksize for audio streams (#759)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 9 Jul 2023 22:00:07 +0000 (00:00 +0200)
committerGitHub <noreply@github.com>
Sun, 9 Jul 2023 22:00:07 +0000 (00:00 +0200)
music_assistant/server/controllers/streams.py

index 3ed32531f9600403cbe561e69081513601eb1deb..eb179353bb8182b9979def30407a4267584d348a 100644 (file)
@@ -533,7 +533,7 @@ class StreamsController(CoreController):
             ffmpeg_proc.attach_task(read_audio())
 
             # read final chunks from stdout
-            async for chunk in ffmpeg_proc.iter_any():
+            async for chunk in ffmpeg_proc.iter_chunked():
                 try:
                     await resp.write(chunk)
                 except (BrokenPipeError, ConnectionResetError):
@@ -736,7 +736,7 @@ class StreamsController(CoreController):
             ffmpeg_proc.attach_task(read_audio())
 
             # read final chunks from stdout
-            async for chunk in ffmpeg_proc.iter_any():
+            async for chunk in ffmpeg_proc.iter_chunked():
                 try:
                     await resp.write(chunk)
                 except (BrokenPipeError, ConnectionResetError):