Make sure that when only reading metadata of the flac stream, and issuing flac-stop, the flac decoder is really finished and deleted.
This commit is contained in:
+9
-2
@@ -171,14 +171,21 @@
|
|||||||
(define (flac-stop handle)
|
(define (flac-stop handle)
|
||||||
(let ((ct (current-milliseconds)))
|
(let ((ct (current-milliseconds)))
|
||||||
(dbg-sound "requesting stop at: ~a" ct)
|
(dbg-sound "requesting stop at: ~a" ct)
|
||||||
|
(if (flac-handle-reading handle)
|
||||||
|
(begin ; in reading
|
||||||
(set-flac-handle-stop-reading! handle #t)
|
(set-flac-handle-stop-reading! handle #t)
|
||||||
(while (flac-handle-reading handle)
|
(while (flac-handle-reading handle)
|
||||||
(sleep 0.01))
|
(sleep 0.01)))
|
||||||
|
(begin ; never starte reading, or reading finished
|
||||||
|
(dbg-sound "not reading flac, need to finish flac")
|
||||||
|
(let ((ffi-handler (flac-handle-ffi-decoder-handler handle)))
|
||||||
|
(unless (eq? ffi-handler #f)
|
||||||
|
(ffi-handle 'delete))))
|
||||||
|
)
|
||||||
(let ((ct* (current-milliseconds)))
|
(let ((ct* (current-milliseconds)))
|
||||||
(dbg-sound "stop came back at: ~a" ct*)
|
(dbg-sound "stop came back at: ~a" ct*)
|
||||||
(dbg-sound "flac-stop took: ~a ms" (- ct* ct)))
|
(dbg-sound "flac-stop took: ~a ms" (- ct* ct)))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
); end of module
|
); end of module
|
||||||
|
|||||||
Reference in New Issue
Block a user