mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 05:15:49 +03:00
[PR #121] [MERGED] feat: improve efficiency of the decryptor #222
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#222
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/devgianlu/go-librespot/pull/121
Author: @aykevl
Created: 10/7/2024
Status: ✅ Merged
Merged: 10/12/2024
Merged by: @devgianlu
Base:
master← Head:perf-decryptor-2📝 Commits (1)
e7dd509feat: improve efficiency of the decryptor📊 Changes
1 file changed (+10 additions, -10 deletions)
View changed files
📝
audio/decryptor.go(+10 -10)📄 Description
The decryptor was using up a lot of time. For a ~10min song it took about twice the time that it took to run the Vorbis decoder and this time would only go up considering the exponential nature of the loop.
But actually, all it did was count up a number. This can be done using a simple addition instead of a complicated loop. Hence this patch changes the loop to a simple addition.
It is 32-bits at the moment, which means it would overflow with a stream that'sUpdated to be 64 bits to make me feel better, this is extremely unlikely to ever overflow.64GB48GB big. This is entirely fixable if needed, but 48GB seems like an unlikely large stream.This replaces #120.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.