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! feed-interrupted #f)
(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
void
(λ ()
@@ -475,12 +478,10 @@
(with-handlers ([exn:fail? (λ (e)
(if (eq? ch-evt #f)
(raise e)
(begin
(evt (list 'exception
(exn-message e)))
(let ((code (if (exn:fail:audio? e) (exn:fail:audio-code e) 'no-audio-error)))
(evt (list 'exception (exn-message e) code))
(when in-rpc
(put (list 'error
(exn-message e)))
(put (list 'error (exn-message e) code))
(set! in-rpc #f))
(loop))
))])
@@ -568,7 +569,7 @@
))
(else
(do-rpc
(list 'error (format "Unknown command ~a" cmd))))
(list 'error (format "Unknown command ~a" cmd) 'error-unknown-command)))
)
(loop)
)