Commit 18eb5be
fix: skip server cleanup on session loss to keep playback alive
Symptoms observed in logs — the TCP session dies, then cleanup fails:
ERROR librespot_core::session Connection to server closed.
WARN librespot_connect::spirc unexpected shutdown
ERROR librespot_core::session Broken pipe (os error 32)
ERROR librespot_core::session Transport endpoint is not connected (os error 107)
WARN librespot Spirc shut down unexpectedly
When SpircTask exits because session.is_invalid(), the post-loop
cleanup called handle_disconnect() (which sets play_status to Stopped
and tries to notify Spotify), delete_connect_state_request(), and
dealer().close(). All of these fail because the TCP connection is dead,
and setting play_status to Stopped needlessly kills the Player.
Now we detect session.is_invalid() and skip all server communication
in the post-loop cleanup. The Player runs in a separate thread and
continues playing from its audio buffer. main.rs will create a new
session and Spirc.
After fix — the "Broken pipe" and "Transport endpoint is not
connected" errors no longer appear after session loss. The Player
continues playing while the session reconnects (see next commit for
state restoration evidence).
Co-authored-by: Copilot <[email protected]>1 parent 812c972 commit 18eb5be
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
602 | 610 | | |
603 | 611 | | |
604 | 612 | | |
| |||
0 commit comments