Commit 17eb29e
fix: let audio buffer drain on track end instead of clearing it
The decode thread finishes faster than real-time (especially for WAV),
so TrackEnded fires while audio is still buffered. Previously,
stop_decode() cleared the buffer, cutting off playback. Now when
reaching end of tracklist, we let the cpal output thread drain
remaining audio naturally.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>1 parent 308af92 commit 17eb29e
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
359 | 361 | | |
360 | 362 | | |
361 | 363 | | |
| |||
0 commit comments