mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 16:25:52 +03:00
[PR #1176] [MERGED] Use a single player instance #1264
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1264
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/1176
Author: @jlehtoranta
Created: 6/13/2023
Status: ✅ Merged
Merged: 7/19/2023
Merged by: @roderickvd
Base:
dev← Head:single-player📝 Commits (8)
46195f1Handle play_request_id as an eventddadcc9Add a health check method to playerc6b62b8Allow player session changese3db099Use single player and mixer instancese5abed7Exit with an error when the player instance is invalid02c9be3Reset session after spirc crashc60c4f4Start a new session on credentials changeb1c6641Update changelog (#1176)📊 Changes
8 files changed (+100 additions, -51 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
connect/src/spirc.rs(+11 -5)📝
examples/play.rs(+1 -1)📝
examples/play_connect.rs(+2 -1)📝
playback/src/mixer/mod.rs(+6 -4)📝
playback/src/player.rs(+32 -18)📝
src/main.rs(+41 -22)📝
src/player_event_handler.rs(+4 -0)📄 Description
Create a single player instance, when librespot starts and keep it running over reconnections. In the current implementation the player is recreated on every reconnection, which causes the output device to be recreated too. This creates a racing condition in Jack, which occasionally causes the output device to be created with a different name. This is an issue especially when using Jack's custom routing. I.e. A different user connects via Spotify Connect and Jack doesn't create the configured audio route because of the name change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.