mirror of
https://github.com/make-42/xyosc
synced 2024-11-22 09:10:09 +01:00
fix: ring buffer race condition issues
This commit is contained in:
parent
76bccc8a90
commit
7f8f57728a
@ -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))
|
||||
}
|
||||
|
||||
|
2
main.go
2
main.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user