From 17bff20fe3762c9370b1106a2ff107cf62925fa6 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 3 Nov 2025 20:24:36 +0100 Subject: [PATCH] Small tweaks --- music_assistant/helpers/audio.py | 2 -- music_assistant/helpers/ffmpeg.py | 8 ++------ music_assistant/providers/builtin_player/player.py | 2 +- music_assistant/providers/resonate/player.py | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/music_assistant/helpers/audio.py b/music_assistant/helpers/audio.py index aa01db76..4015e13d 100644 --- a/music_assistant/helpers/audio.py +++ b/music_assistant/helpers/audio.py @@ -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: diff --git a/music_assistant/helpers/ffmpeg.py b/music_assistant/helpers/ffmpeg.py index d05d0a59..1daffa7a 100644 --- a/music_assistant/helpers/ffmpeg.py +++ b/music_assistant/helpers/ffmpeg.py @@ -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 diff --git a/music_assistant/providers/builtin_player/player.py b/music_assistant/providers/builtin_player/player.py index 48ff4306..2b0b79dc 100644 --- a/music_assistant/providers/builtin_player/player.py +++ b/music_assistant/providers/builtin_player/player.py @@ -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: diff --git a/music_assistant/providers/resonate/player.py b/music_assistant/providers/resonate/player.py index 92ece5db..2d38f3e1 100644 --- a/music_assistant/providers/resonate/player.py +++ b/music_assistant/providers/resonate/player.py @@ -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 ), ) -- 2.34.1