mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #6] [MERGED] Make librespot more robust against audio failures #774
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#774
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/6
Author: @brain0
Created: 12/18/2017
Status: ✅ Merged
Merged: 12/19/2017
Merged by: @ComlOnline
Base:
master← Head:work📝 Commits (4)
35ec580Disable the "variable does not need to be mutable" compiler warning in generated codef5d8019Add proper error handling to the pulseaudio backend and ensure that no invalid pointers are passed to pulseaudiof250179Join the player thread when the player is dropped4cda8afHandle audio sink errors in the player📊 Changes
7 files changed (+160 additions, -56 deletions)
View changed files
📝
Cargo.lock(+8 -7)📝
Cargo.toml(+2 -1)📝
core/src/lib.in.rs(+1 -0)📝
src/audio_backend/pulseaudio.rs(+66 -26)📝
src/lib.in.rs(+1 -0)📝
src/lib.rs(+3 -0)📝
src/player.rs(+79 -22)📄 Description
When using librespot with pulseaudio over TCP, connection failures always lead to panics. This patchset introduces proper error handling in the pulseaudio backend and ensures that no undefined behaviour occurs in the FFI calls to pulseaudio. It also introduces proper error handling in the player thread: When the player fails to open or write audio, instead of panicking, it tries to reconnect to the sink every 5 seconds until it succeeds or playback is stopped.
With this patchset, librespot has been very reliable when running with pulseaudio and setting PULSE_SERVER to a remote host, even when the remote host goes down and comes up again.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.