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
+8
View File
@@ -67,6 +67,7 @@
(player-state 'stopped)
(decoder-buf-info #f)
(decoder-meta #f)
(playback-error #f)
(feeding-audio #f)
(feed-interrupted #f)
)
@@ -114,6 +115,7 @@
(set! feeding-audio #f)
(set! feed-interrupted #f)
(set! player-state 'stopped)
(set! playback-error (exn-message e))
(let ((code (if (exn:fail:audio? e) (exn:fail:audio-code e) 'no-audio-error)))
(state (format "audio-read-worker: exception ~a" code) evt)
(evt (list 'exception (exn-message e) code)))
@@ -330,12 +332,15 @@
(cleanup)
(set! playback-error #f)
(state "stop-and-cleanup: stopped/cleaned" evt 'force)
player-state
)
(define (start file)
(when playback-error (stop-and-cleanup))
(set! playback-error #f)
(dbg-sound "starting ~a" file)
(when feeding-audio
(dbg-sound "interrupting feed")
@@ -361,6 +366,8 @@
)
;; A failed earlier Stop must not suppress this track's EOF notification.
(set! feed-interrupted #f)
;(set! current-file-id (+ current-file-id 1))
(set! current-file-id (+ (* (get-current-seconds) 10000) (random 1000)))
(let ((f (build-path file)))
@@ -443,6 +450,7 @@
(hash-set! h 'at-music-id m-id)
(hash-set! h 'volume current-volume)
(hash-set! h 'buf-size (if (ao-valid? ao-h) (ao-bufsize-async ao-h) 0))
(hash-set! h 'error playback-error)
(hash-set! h 'reuse-buf-len (if (ao-valid? ao-h)
(ao-reuse-buf-len-async ao-h)
#f))