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

Configure all mounts to fall back to silence

Unless an explicit fallback is configured. Untested.
parent a4b78e24
No related branches found
No related tags found
1 merge request!1v2.0
......@@ -12,6 +12,11 @@ override_dh_auto_install:
dh_auto_install
$(RM) -rv $(DESTDIR)/usr/share/gocode
# Install our silent snippets to the Icecast web dir.
install -d -m 755 -o root -g root $(DESTDIR)/usr/share/icecast2/web
(for f in silence.ogg silence.mp3; do \
install -m 644 -o root -g root $$f $(DESTDIR)/usr/share/icecast2/web/$$f; done)
override_dh_installinit:
dh_installinit --name=autoradio
......
......@@ -9,6 +9,7 @@ import (
"net"
"net/url"
"os"
"path/filepath"
"git.autistici.org/ale/autoradio"
pb "git.autistici.org/ale/autoradio/proto"
......@@ -262,15 +263,26 @@ 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,
Name: autoradio.MountPathToIcecastPath(m.Path),
Username: m.SourceUsername,
Password: m.SourcePassword,
FallbackOverride: 1,
// MaxListeners: 1000,
// NoYp: 1,
}
if m.FallbackPath != "" {
// 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 != "":
mc.FallbackMount = m.FallbackPath
mc.FallbackOverride = 1
case filepath.Ext(m.Path) == ".ogg":
mc.FallbackMount = "/silence.ogg"
default:
mc.FallbackMount = "/silence.mp3"
}
return &mc
}
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment