From 8cccf4325c7f884b9be08df2e1abbc3c47720e85 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Sun, 15 May 2022 17:07:30 +0200 Subject: [PATCH] Updated Kirika to avoid overriding Mono filter source buffers --- config.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- queue.go | 8 +------- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/config.go b/config.go index c79517e..bb0ea80 100644 --- a/config.go +++ b/config.go @@ -30,7 +30,7 @@ type Config struct { Logo string `toml:"logo"` Private bool `toml:"private"` } `toml:"radio"` - Streams []StreamConfig `toml:"streams"` + Streams []*StreamConfig `toml:"streams"` } type StreamConfig struct { diff --git a/go.mod b/go.mod index 9972eff..aaee743 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.gammaspectra.live/S.O.N.G/MeteorLight go 1.18 require ( - git.gammaspectra.live/S.O.N.G/Kirika v0.0.0-20220515143733-468ec9b491d1 + git.gammaspectra.live/S.O.N.G/Kirika v0.0.0-20220515150532-713835cd8589 github.com/BurntSushi/toml v1.1.0 github.com/dhowden/tag v0.0.0-20201120070457-d52dcb253c63 github.com/enriquebris/goconcurrentqueue v0.6.3 diff --git a/go.sum b/go.sum index 2044661..f10ef79 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.gammaspectra.live/S.O.N.G/Kirika v0.0.0-20220515143733-468ec9b491d1 h1:3k49C82QXtvONyQk51XPz2cGIOkmhmmMAggWM/RW8tg= -git.gammaspectra.live/S.O.N.G/Kirika v0.0.0-20220515143733-468ec9b491d1/go.mod h1:65QohfAwsgMkXS7PZO2cm8VgPEZlhKC+JAeZfJBYpFE= +git.gammaspectra.live/S.O.N.G/Kirika v0.0.0-20220515150532-713835cd8589 h1:n2LlSes9EO8xF4wfPgo/C7u697RUFJ/YaW6F6jC/dco= +git.gammaspectra.live/S.O.N.G/Kirika v0.0.0-20220515150532-713835cd8589/go.mod h1:65QohfAwsgMkXS7PZO2cm8VgPEZlhKC+JAeZfJBYpFE= git.gammaspectra.live/S.O.N.G/go-alac v0.0.0-20220421115623-d0b3bfe57e0f h1:CxN7zlk5FdAieyRKQSbwBGBsvQ2cDF8JVCODZpzcRkA= git.gammaspectra.live/S.O.N.G/go-alac v0.0.0-20220421115623-d0b3bfe57e0f/go.mod h1:f1+h7KOnuM9zcEQp7ri4UaVvgX4m1NFFIXgReIyjGMA= git.gammaspectra.live/S.O.N.G/go-ebur128 v0.0.0-20220418202343-73a167e76255 h1:BWRx2ZFyhp5+rsXhdDZtk5Gld+L44lxlN9ASqB9Oj0M= diff --git a/queue.go b/queue.go index 98cdbe6..41f17b9 100644 --- a/queue.go +++ b/queue.go @@ -204,7 +204,7 @@ func NewQueue(config *Config) *Queue { sources := SplitAudioSource(filter.NewFilterChain(q.audioQueue.GetSource(), filter.NewBufferFilter(16), filter.NewRealTimeFilter(blocksPerSecond), filter.NewBufferFilter(maxBufferSize*blocksPerSecond)), len(config.Streams)) for i, s := range q.config.Streams { - mount := NewStreamMount(sources[i], &s) + mount := NewStreamMount(sources[i], s) if mount == nil { log.Panicf("could not initialize %s\n", s.MountPath) } @@ -650,12 +650,6 @@ func (q *Queue) HandleRadioRequest(writer http.ResponseWriter, request *http.Req return nil } - type headerData struct { - Channels int64 - SampleRate int64 - MimeType string - } - headerBytes := new(bytes.Buffer) binary.Write(headerBytes, binary.LittleEndian, int64(mount.Channels))