fix: ring buffer race condition issues

This commit is contained in:
Louis Dalibard 2024-10-21 13:56:50 +02:00
parent 76bccc8a90
commit 7f8f57728a
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ var SampleSizeInBytes uint32
const format = malgo.FormatF32
func Init() {
SampleRingBuffer = ringbuffer.New(int(config.Config.RingBufferSize))
SampleRingBuffer = ringbuffer.New(int(config.Config.RingBufferSize)).SetBlocking(true)
SampleSizeInBytes = uint32(malgo.SampleSizeInBytes(format))
}

View File

@ -50,7 +50,7 @@ func main() {
}
//audio.SampleRingBuffer.Reset()
if config.Config.FPSCounter {
rl.DrawFPS(16, config.Config.WindowHeight)
rl.DrawFPS(16, config.Config.WindowHeight-32)
}
rl.DrawTextEx(fonts.FontIosevka32, media.PlayingMediaInfo.Artist+" - "+media.PlayingMediaInfo.Title, rl.NewVector2(16, 16), 32, 2, config.AccentColor)
rl.DrawTextEx(fonts.FontIosevka16, media.PlayingMediaInfo.Album, rl.NewVector2(16, 48), 16, 1, config.ThirdColor)