small buf-size bug

This commit is contained in:
2026-05-07 15:55:05 +02:00
parent 51697f2106
commit b69f29075f
2 changed files with 12 additions and 3 deletions
+7
View File
@@ -0,0 +1,7 @@
#lang racket/base
(require ffi/unsafe
"private/utils.rkt"
)
+4 -2
View File
@@ -166,9 +166,11 @@
(let ((el (if (<= ms-wait 0)
(sync/timeout 0 (ao-handle-queue h))
(sync/timeout (/ ms-wait 1000.0) (ao-handle-queue h) ))))
(unless (eq? el #f)
(if (eq? el #f)
(set-ao-handle-buf-size! h 0) ; no elements in queue => empty => no buffer with music samples
(set-ao-handle-buf-size! h (- (ao-handle-buf-size h) (queue-elem-buflen el))))
el))
el)
)
(define (needed-bytes h)