much work on the player and hunting for a bug, which first seemed to be in ffmpeg-decoder, but eventually was found in a race condition in audio-placed-player.rkt and an allocation problem in libao-async-ffi-racket.rkt

This commit is contained in:
2026-05-15 22:11:25 +02:00
parent 3c18e75cf6
commit c9a91bf2be
11 changed files with 534 additions and 340 deletions
+21 -12
View File
@@ -6,15 +6,17 @@
racket/runtime-path
racket/path
early-return
"tests.rkt"
)
(define place-mode #t)
(define place-mode #f)
(define run-queue #f)
(define (set-test a)
(set! run-queue a))
(define-runtime-path tests "../racket-audio-test")
(define test-file2 (build-path tests "idyll.flac"))
(define test-file3 (build-path tests "mahler-1.mp3"))
(define test-file4 (build-path tests "mahler-2.mp3"))
(define play-queue (list test-file2 test-file3 test-file4))
(define current-sec -1)
(define (to-time-str s*)
@@ -53,19 +55,26 @@
)
(define (audio-player-eof h)
(if (null? play-queue)
(audio-quit! h)
(begin
(audio-play! h (car play-queue))
(set! play-queue (cdr play-queue))
)
)
(dbg-sound "audio-player-eof called")
(when (eq? run-queue 'queue)
(if (null? play-queue)
(audio-quit! h)
(begin
(audio-play! h (car play-queue))
(set! play-queue (cdr play-queue))
)
))
(when (eq? run-queue 'once)
(set! run-queue #f)
(audio-play! h test-file3))
)
(define h (make-audio-player audio-player-state
audio-player-eof
#:use-place place-mode))
(sl-log-to-display)
(audio-player-eof h)