[PR #3] [MERGED] feat: improved seeking #177

Closed
opened 2026-02-28 14:26:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/devgianlu/go-librespot/pull/3
Author: @devgianlu
Created: 10/12/2023
Status: Merged
Merged: 10/18/2023
Merged by: @devgianlu

Base: masterHead: improved-seeking


📝 Commits (4)

  • b194d6e Improve resumed playback seek position
  • 15c229a Parse ogg metadata page fully
  • 768c9ee Ensure proper ogg/vorbis cleanup
  • 8bc5cce Decoder cleanup and improved seeking

📊 Changes

6 files changed (+293 additions, -190 deletions)

View changed files

audio/metadata.go (+225 -0)
audio/replay_gain.go (+0 -50)
📝 cmd/daemon/controls.go (+5 -0)
📝 player/player.go (+7 -7)
📝 vorbis/decoder.go (+56 -40)
vorbis/utils.go (+0 -93)

📄 Description

This is an attempt at improving the seeking algorithm. The old way is completely bogus because lots of error adds up when seeking far from the beginning of the stream. The method implement now requires to fetch the entire stream to find the precise location which is not ideal.

This changes are required for a good playback experience on devices that use very long output buffers (pipewire on Fedora default to 10s): when pausing we throw away 10s of frames which must be rewinded in the decoder before resuming playback or they'll be lost.

Currently reverse enginnering the propertary seek table in the first ogg metadata page (mentioned here).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/devgianlu/go-librespot/pull/3 **Author:** [@devgianlu](https://github.com/devgianlu) **Created:** 10/12/2023 **Status:** ✅ Merged **Merged:** 10/18/2023 **Merged by:** [@devgianlu](https://github.com/devgianlu) **Base:** `master` ← **Head:** `improved-seeking` --- ### 📝 Commits (4) - [`b194d6e`](https://github.com/devgianlu/go-librespot/commit/b194d6e978ce4e2fcc3652d09a90abb2ce2933be) Improve resumed playback seek position - [`15c229a`](https://github.com/devgianlu/go-librespot/commit/15c229a018c44d438ff05e14c377e88af8bba939) Parse ogg metadata page fully - [`768c9ee`](https://github.com/devgianlu/go-librespot/commit/768c9ee112581ab6e326af2ae4b45363e92ff567) Ensure proper ogg/vorbis cleanup - [`8bc5cce`](https://github.com/devgianlu/go-librespot/commit/8bc5ccebe403827a3c7e625975e84c6ec94718c0) Decoder cleanup and improved seeking ### 📊 Changes **6 files changed** (+293 additions, -190 deletions) <details> <summary>View changed files</summary> ➕ `audio/metadata.go` (+225 -0) ➖ `audio/replay_gain.go` (+0 -50) 📝 `cmd/daemon/controls.go` (+5 -0) 📝 `player/player.go` (+7 -7) 📝 `vorbis/decoder.go` (+56 -40) ➖ `vorbis/utils.go` (+0 -93) </details> ### 📄 Description This is an attempt at improving the seeking algorithm. The old way is completely bogus because lots of error adds up when seeking far from the beginning of the stream. The method implement now requires to fetch the entire stream to find the precise location which is not ideal. This changes are required for a good playback experience on devices that use very long output buffers (pipewire on Fedora default to 10s): when pausing we throw away 10s of frames which must be rewinded in the decoder before resuming playback or they'll be lost. Currently reverse enginnering the propertary seek table in the first ogg metadata page (mentioned [here](https://developer.spotify.com/documentation/commercial-hardware/implementation/guides/media-delivery)). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 14:26:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#177
No description provided.