From 905c9153f7d3c6828e8c53946d5da370fb9b2113 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Thu, 7 May 2026 14:29:55 +0200 Subject: [PATCH] paused handling --- libao-async-ffi-racket.rkt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libao-async-ffi-racket.rkt b/libao-async-ffi-racket.rkt index 933c3da..cf0441a 100644 --- a/libao-async-ffi-racket.rkt +++ b/libao-async-ffi-racket.rkt @@ -160,7 +160,7 @@ #:mutable ) -(define ao-buf-ms 50) ;; Playback buffer of 0.5s +(define ao-buf-ms 500) ;; Playback buffer of 0.5s (define (get h ms-wait) (let ((el (if (<= ms-wait 0) @@ -469,12 +469,14 @@ (mutex-lock (ao-handle-pause-mutex h)) (mutex-unlock (ao-handle-pause-mutex h)) (mutex-lock (ao-handle-clear-mutex h)) - (let ((elem (get h 250))) + (let ((if (ao-handle-paused h) + #f + (elem (get h 250)))) (mutex-unlock (ao-handle-clear-mutex h)) (if (eq? elem #f) (begin (dbg-sound "nothing in the queue") - (sleep 0.005)) + (sleep 0.01)) (begin (if (eq? (queue-elem-command elem) 'stop) (set! go-on #f)