mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #297] [MERGED] Improve playback speed #866
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#866
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/297
Author: @kaymes
Created: 3/9/2019
Status: ✅ Merged
Merged: 3/13/2019
Merged by: @sashahilton00
Base:
master← Head:kaymes-faster📝 Commits (5)
a3c63b4Speed up loading of files by requesting file and key in parallel.2e492e4Speed up playback by avoiding unnecessary seek when playing from the beginning of a file.f62709fMerge remote-tracking branch 'origin/master' into kaymes-faster43959eeCommit missing ;43dcc6bRemove deft over debug message.📊 Changes
1 file changed (+9 additions, -7 deletions)
View changed files
📝
playback/src/player.rs(+9 -7)📄 Description
I did some profiling to figure out why librespot is so much slower than the official Spotify client to start a playback. Of the issues I found, two were quick fixes, which I'm committing here.
seek() on an audio stream is a very slow operation here because under the hood we do an interval search over the file. Thus, many different parts of the file must be downloaded inspected. Librespot does such a seek when playing a file from the beginning. This is unnecessary.
the network requests for downloading the key and the encrypted file can be done in parallel which saves on round trip time.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.