Skip to content

Fix Speed::try_seek to handle seek position independently of speed factor (#876)#881

Closed
FrogSnot wants to merge 1 commit intoRustAudio:masterfrom
FrogSnot:fix/speed-seek-876
Closed

Fix Speed::try_seek to handle seek position independently of speed factor (#876)#881
FrogSnot wants to merge 1 commit intoRustAudio:masterfrom
FrogSnot:fix/speed-seek-876

Conversation

@FrogSnot
Copy link
Copy Markdown

@FrogSnot FrogSnot commented May 5, 2026

Closes #876

As discussed in the issue, seeking while at non-1x speed was incorrectly scaling the seek duration. This PR ensures the seek position is passed directly to the inner source.

Copilot AI review requested due to automatic review settings May 5, 2026 19:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses incorrect seeking behavior when playback speed is set to a non-1.0 factor by changing Speed::try_seek so it forwards the requested seek position directly to the inner source (instead of scaling it by the speed factor), and documents the fix.

Changes:

  • Updated Speed::try_seek to pass pos through unchanged.
  • Updated Speed module documentation to state seek is independent of the speed factor.
  • Added a changelog entry for the fix (references #876).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/source/speed.rs Changes Speed::try_seek semantics and updates module docs accordingly.
CHANGELOG.md Records the Speed::try_seek fix under Unreleased.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/source/speed.rs
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
let pos_accounting_for_speedup = pos.mul_f32(self.factor);
self.input.try_seek(pos_accounting_for_speedup)
self.input.try_seek(pos)
Comment thread src/source/speed.rs
Comment on lines +142 to 144
self.input.try_seek(pos)
}
}
@FrogSnot FrogSnot closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed::try_seek incorrectly multiplies seek position by speed factor

2 participants