spdif: Handle soundcard asleep, try to wake up with a random bitrate

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

View File

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