Small tweaks
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 3 Nov 2025 19:24:36 +0000 (20:24 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 3 Nov 2025 19:24:36 +0000 (20:24 +0100)
music_assistant/helpers/audio.py
music_assistant/helpers/ffmpeg.py
music_assistant/providers/builtin_player/player.py
music_assistant/providers/resonate/player.py

index aa01db7634304e56306613b0f6935509ccb07f23..4015e13d28325cee7a5a3bd4d8a646514543a495 100644 (file)
@@ -1097,7 +1097,6 @@ async def get_multi_file_stream(
     mass: MusicAssistant,  # noqa: ARG001
     streamdetails: StreamDetails,
     seek_position: int = 0,
-    raise_ffmpeg_exception: bool = False,
 ) -> AsyncGenerator[bytes, None]:
     """Return audio stream for a concatenation of multiple files.
 
@@ -1135,7 +1134,6 @@ async def get_multi_file_stream(
                 "-ss",
                 str(seek_position),
             ],
-            raise_ffmpeg_exception=raise_ffmpeg_exception,
         ):
             yield chunk
     finally:
index d05d0a597f8317043c941fbb3b1b239792b5de40..1daffa7a3c516ae0424c67491247cdded32f7642 100644 (file)
@@ -202,7 +202,6 @@ async def get_ffmpeg_stream(
     chunk_size: int | None = None,
     extra_input_args: list[str] | None = None,
     extra_output_args: list[str] | None = None,
-    raise_ffmpeg_exception: bool = False,
 ) -> AsyncGenerator[bytes, None]:
     """
     Get the ffmpeg audio stream as async generator.
@@ -225,12 +224,9 @@ async def get_ffmpeg_stream(
         async for chunk in iterator:
             yield chunk
         if ffmpeg_proc.returncode not in (None, 0):
+            # unclean exit of ffmpeg - raise error with log tail
             log_tail = "\n" + "\n".join(list(ffmpeg_proc.log_history)[-5:])
-            if not raise_ffmpeg_exception:
-                # dump the last 5 lines of the log in case of an unclean exit
-                ffmpeg_proc.logger.error(log_tail)
-            else:
-                raise AudioError(log_tail)
+            raise AudioError(log_tail)
 
 
 def get_ffmpeg_args(  # noqa: PLR0915
index 48ff4306db2cda5d03040c517c02471a3c531c02..2b0b79dc565be3aa0ff4281dbae43ce90a4de02a 100644 (file)
@@ -293,7 +293,7 @@ class BuiltinPlayer(Player):
             # Apple ignores "Accept-Ranges=none" on iOS and iPadOS for some reason,
             # so we need to slowly feed the music to avoid the Browser stopping and later
             # restarting the audio stream (from a wrong position!) by keeping the buffer short.
-            extra_input_args=["-readrate", "1.05", "-readrate_initial_burst", "8"],
+            extra_input_args=["-readrate", "1.02", "-readrate_initial_burst", "6"],
             filter_params=get_player_filter_params(self.mass, player_id, pcm_format, stream_format),
         ):
             try:
index 92ece5db6c3ed3580aa0df9c8d452d84851f5682..2d38f3e19a19c9cbcbc5dded97ef26157e9c28ac 100644 (file)
@@ -232,7 +232,7 @@ class ResonatePlayer(Player):
                 input_format=flow_pcm_format,
                 output_format=pcm_format,
                 filter_params=get_player_filter_params(
-                    self.mass, self.player_id, pcm_format, pcm_format
+                    self.mass, self.player_id, flow_pcm_format, pcm_format
                 ),
             )