From 9f4d8421e515109d609b4846cd7b59e25aee9731 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Mon, 1 Jun 2020 11:42:46 +0100
Subject: [PATCH] Disable autogeneration of silence.ogg fallback mount

---
 node/icecast/config.go | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/node/icecast/config.go b/node/icecast/config.go
index 432ca477..0786c5f4 100644
--- a/node/icecast/config.go
+++ b/node/icecast/config.go
@@ -9,7 +9,6 @@ import (
 	"net"
 	"net/url"
 	"os"
-	"path/filepath"
 
 	"git.autistici.org/ale/autoradio"
 	pb "git.autistici.org/ale/autoradio/proto"
@@ -263,25 +262,17 @@ func slaveMountConfig(m *pb.Mount, masterAddr string) (*iceRelayConfig, error) {
 
 func masterMountConfig(m *pb.Mount) *iceMountConfig {
 	mc := iceMountConfig{
-		Name:             autoradio.MountPathToIcecastPath(m.Path),
-		Username:         m.SourceUsername,
-		Password:         m.SourcePassword,
-		FallbackOverride: 1,
+		Name:     autoradio.MountPathToIcecastPath(m.Path),
+		Username: m.SourceUsername,
+		Password: m.SourcePassword,
 		// MaxListeners: 1000,
 		// NoYp:   1,
 	}
 
-	// When no explicit fallback URL is specified, use the locally
-	// installed silence audo file. In order to serve the right
-	// format, we guess the file extension for the silence
-	// fallback by looking at the extension of the mount itself.
-	switch {
-	case m.FallbackPath != "":
+	// Set the explicit fallback URL if present.
+	if m.FallbackPath != "" {
 		mc.FallbackMount = m.FallbackPath
-	case filepath.Ext(m.Path) == ".ogg":
-		mc.FallbackMount = "/silence.ogg"
-	default:
-		mc.FallbackMount = "/silence.mp3"
+		mc.FallbackOverride = 1
 	}
 
 	return &mc
-- 
GitLab