You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(audio): cancel stream downloads at teardown so quit can't freeze
rodio decodes inside the CoreAudio render callback, and StreamDownload::read
blocks on a condvar only writer progress or "stream done" can wake. When a
live stream goes quiet (e.g. a daily broadcast ending), stream-download's
reconnect loop retries forever without signalling, the callback wedges in
read, and AudioPlayer teardown then hangs dropping the device sink
(AudioOutputUnitStop waits on the callback) — freezing the app on quit until
force-quit, which orphans the yt-dlp/ffmpeg children.
AudioPlayer now keeps the download's CancellationToken (HTTP and process
inputs) and cancels it in a custom Drop before fields drop: stream-download
kills the child pipeline and signals stream done, waking any wedged reader.
This also reliably reaps yt-dlp/ffmpeg on every track transition and quit.
New ignored test reproduces the stall (ffmpeg emits 6s of audio then stalls
without EOF) and guards the fix.
Companion fixes for deleting the currently-playing history row mid-play:
record_playback_time treats the missing row as a no-op instead of erroring
(kills the "Record not found" warning smeared over the TUI), and starring
always materializes the row first instead of crashing on NotFound.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments