fix playback of local files
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 17 Aug 2022 23:32:29 +0000 (01:32 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 17 Aug 2022 23:32:29 +0000 (01:32 +0200)
music_assistant/helpers/audio.py

index ac244237eab826f7c63e3803dcb8361c8aa49bef..37c14f6694c55fc43405a834e07f4adf4612cd62 100644 (file)
@@ -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]