mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 16:25:52 +03:00
[PR #300] [CLOSED] Rewrite and simplify Player #868
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#868
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/300
Author: @udoprog
Created: 3/11/2019
Status: ❌ Closed
Base:
dev← Head:master📝 Commits (2)
879c046Rewrite Player25dafb5Skip unavailable songs📊 Changes
4 files changed (+243 additions, -270 deletions)
View changed files
📝
playback/src/audio_backend/portaudio.rs(+30 -17)📝
playback/src/config.rs(+2 -0)📝
playback/src/player.rs(+210 -253)📝
src/main.rs(+1 -0)📄 Description
Hey,
This is a mostly complete rewrite of how logic is handled in the Player.
Invalidstate any longer. TheEndOfTrackstate has been removed.loaded_track: Option<LoadedTrack>. This makes it clearer what the lifetime of aloaded_trackis and affords us to implement some things decoupled from the state.end_of_trackoneshot is called in theDropimplementation ofLoadedTrackto make sure we don't forget about it. Hopefully this means we can write clients without having to match againstErr(Cancelled)in the receiving end.This was also built on top of a previous patch which incorporated linear volume control:
This adds linear volume control at the same stage as normalization happens and adds player events to control the volume directly.
I'm pretty sure this can be implemented somewhere in the audio backend, as an audio filter, or as part of the mixer. But this avoids iterating over the samples twice if normalization happens anyways by multiplying it with the normalization factor.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
SmallRng#1123