From 789eaf6ea12be9d8d354f43d5d046f18a8ce23d6 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 18 Aug 2022 01:32:29 +0200 Subject: [PATCH] fix playback of local files --- music_assistant/helpers/audio.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/music_assistant/helpers/audio.py b/music_assistant/helpers/audio.py index ac244237..37c14f66 100644 --- a/music_assistant/helpers/audio.py +++ b/music_assistant/helpers/audio.py @@ -697,18 +697,20 @@ async def _get_ffmpeg_args( ] if streamdetails.direct: # ffmpeg can access the inputfile (or url) directly - input_args += [ - "-reconnect", - "1", - "-reconnect_streamed", - "1", - "-reconnect_on_network_error", - "1", - "-reconnect_on_http_error", - "5xx", - "-reconnect_delay_max", - "10", - ] + if streamdetails.direct.startswith("http"): + # append reconnect options for direct stream from http + input_args += [ + "-reconnect", + "1", + "-reconnect_streamed", + "1", + "-reconnect_on_network_error", + "1", + "-reconnect_on_http_error", + "5xx", + "-reconnect_delay_max", + "10", + ] if seek_position: input_args += ["-ss", str(seek_position)] input_args += ["-i", streamdetails.direct] -- 2.34.1