1
0

There is a periodic panic because of out of bounds in GetDuration. Let's catch it and see what songs cause it. Also let's use a little bigger buffer of 6200, but I believe it doesn't fix this panic.

This commit is contained in:
Alexander Andreev 2025-01-05 19:05:58 +04:00
parent a8a9a991d4
commit b9288c0084
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34
2 changed files with 7 additions and 1 deletions

View File

@ -88,6 +88,12 @@ func (dj *DJHandlers) PlaylistNext(w http.ResponseWriter, _ *http.Request) {
return return
} }
defer func() {
if err := recover(); err != nil {
log.Printf("Panic occured with %s: %s", nxt, err)
}
}()
newSong := radio.Song{ newSong := radio.Song{
Artist: oggf.GetTag("artist"), Artist: oggf.GetTag("artist"),
Title: oggf.GetTag("title"), Title: oggf.GetTag("title"),

View File

@ -13,7 +13,7 @@ import (
) )
const ( const (
bufferLength = 6144 bufferLength = 6200
OggS = "OggS" OggS = "OggS"
OggSLen = len(OggS) OggSLen = len(OggS)
Vorbis = "vorbis" Vorbis = "vorbis"