Skip to content
Snippets Groups Projects
Commit 9f4d8421 authored by ale's avatar ale
Browse files

Disable autogeneration of silence.ogg fallback mount

parent 08e05ac3
Branches
No related tags found
No related merge requests found
...@@ -9,7 +9,6 @@ import ( ...@@ -9,7 +9,6 @@ import (
"net" "net"
"net/url" "net/url"
"os" "os"
"path/filepath"
"git.autistici.org/ale/autoradio" "git.autistici.org/ale/autoradio"
pb "git.autistici.org/ale/autoradio/proto" pb "git.autistici.org/ale/autoradio/proto"
...@@ -263,25 +262,17 @@ func slaveMountConfig(m *pb.Mount, masterAddr string) (*iceRelayConfig, error) { ...@@ -263,25 +262,17 @@ func slaveMountConfig(m *pb.Mount, masterAddr string) (*iceRelayConfig, error) {
func masterMountConfig(m *pb.Mount) *iceMountConfig { func masterMountConfig(m *pb.Mount) *iceMountConfig {
mc := iceMountConfig{ mc := iceMountConfig{
Name: autoradio.MountPathToIcecastPath(m.Path), Name: autoradio.MountPathToIcecastPath(m.Path),
Username: m.SourceUsername, Username: m.SourceUsername,
Password: m.SourcePassword, Password: m.SourcePassword,
FallbackOverride: 1,
// MaxListeners: 1000, // MaxListeners: 1000,
// NoYp: 1, // NoYp: 1,
} }
// When no explicit fallback URL is specified, use the locally // Set the explicit fallback URL if present.
// installed silence audo file. In order to serve the right if m.FallbackPath != "" {
// format, we guess the file extension for the silence
// fallback by looking at the extension of the mount itself.
switch {
case m.FallbackPath != "":
mc.FallbackMount = m.FallbackPath mc.FallbackMount = m.FallbackPath
case filepath.Ext(m.Path) == ".ogg": mc.FallbackOverride = 1
mc.FallbackMount = "/silence.ogg"
default:
mc.FallbackMount = "/silence.mp3"
} }
return &mc return &mc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment