premature flac decode deletion solved

This commit is contained in:
2026-10-30 09:17:54 +01:00
parent 1d9899c0d2
commit b1c6e3976a
6 changed files with 139 additions and 26 deletions
+9 -7
View File
@@ -66,17 +66,17 @@ handler.
}
@defproc[(flac-read [handle flac-handle?])
(or/c 'stopped-reading
'end-of-stream)]{
void?]{
Reads the stream by repeatedly calling the native decoder with
@racket['process-single].
Before reading starts, the handle fields @racket[stop-reading]
and @racket[reading] are set to @racket[#f] and @racket[#t]. If a
stop has been requested with @racket[flac-stop], reading ends
with @racket['stopped-reading] and @racket[reading] is reset to
@racket[#f].
stop has been requested with @racket[flac-stop], the read loop ends.
Native decoder cleanup runs on normal completion, exceptions and breaks; only
after cleanup does @racket[reading] become @racket[#f]. Decoder failures and
errors raised by the audio consumer propagate to the caller.
Whenever pending metadata is available, it is processed with
@racket[process-meta]. For metadata of type
@@ -121,8 +121,10 @@ The procedure then waits until the handle field
@racket[reading] becomes @racket[#f], sleeping for 10 ms between
checks.
The procedure prints timing information before and after the
wait.
If reading has already finished or never started, the native decoder is
released directly. Calling @racket[flac-stop] repeatedly, including after EOF
or a failed read, is safe. The procedure logs timing information before and
after the wait.
}
@defproc[(flac-duration [handle flac-handle?])