Changing audio-placed-player to handle audio errors better.

This commit is contained in:
2026-07-07 09:49:07 +02:00
parent 83f1d0d2ac
commit 8ae86dafea
+8 -7
View File
@@ -113,7 +113,10 @@
(set! feeding-audio #f) (set! feeding-audio #f)
(set! feed-interrupted #f) (set! feed-interrupted #f)
(set! player-state 'stopped) (set! player-state 'stopped)
(evt (list 'exception (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)))
)])
(dynamic-wind (dynamic-wind
void void
(λ () (λ ()
@@ -475,12 +478,10 @@
(with-handlers ([exn:fail? (λ (e) (with-handlers ([exn:fail? (λ (e)
(if (eq? ch-evt #f) (if (eq? ch-evt #f)
(raise e) (raise e)
(begin (let ((code (if (exn:fail:audio? e) (exn:fail:audio-code e) 'no-audio-error)))
(evt (list 'exception (evt (list 'exception (exn-message e) code))
(exn-message e)))
(when in-rpc (when in-rpc
(put (list 'error (put (list 'error (exn-message e) code))
(exn-message e)))
(set! in-rpc #f)) (set! in-rpc #f))
(loop)) (loop))
))]) ))])
@@ -568,7 +569,7 @@
)) ))
(else (else
(do-rpc (do-rpc
(list 'error (format "Unknown command ~a" cmd)))) (list 'error (format "Unknown command ~a" cmd) 'error-unknown-command)))
) )
(loop) (loop)
) )