spdif: Handle soundcard asleep, try to wake up with a random bitrate
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
nemunaire 2024-11-29 09:58:09 +01:00
parent 484e0f5295
commit 5d70cecaea

View File

@ -82,6 +82,11 @@ func (s *SPDIFSource) Enable() error {
} }
s.Bitrate = sr s.Bitrate = sr
// If no bitrate, asume soundcard is sleeping, try to wake up with a random bitrate
if sr == 0 {
sr = 44100
}
pipeR, pipeW, err := os.Pipe() pipeR, pipeW, err := os.Pipe()
if err != nil { if err != nil {
return err return err