Skip to content

Commit 8fe6b1b

Browse files
committed
Fix Speed::try_seek to handle seek position independently of speed factor (#876)
1 parent 1f92796 commit 8fe6b1b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4747
- Fixed sources to correctly handle sample rate and channel count changes at span boundaries.
4848
- Fixed sources to detect parameter updates after mid-span seeks.
4949
- Fixed `Stoppable` and `Skippable` not signaling exhaustion.
50+
- Fixed `Speed::try_seek` to pass seek position directly to inner source without accounting for speed factor (#876).
5051

5152
## Version [0.22.2] (2026-02-22)
5253

src/source/speed.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! In order to speed up a sink, the speed struct:
77
//! - Increases the current sample rate by the given factor.
88
//! - Updates the total duration function to cover for the new factor by dividing by the factor.
9-
//! - Updates the try_seek function by multiplying the audio position by the factor.
9+
//! - Passes the seek position directly to the inner source (independent of speed factor).
1010
//!
1111
//! To speed up a source from sink all you need to do is call the `set_speed(factor: f32)` function
1212
//! For example, here is how you speed up your sound by using sink or playing raw:
@@ -139,7 +139,6 @@ where
139139

140140
#[inline]
141141
fn try_seek(&mut self, pos: Duration) -> Result<(), SeekError> {
142-
let pos_accounting_for_speedup = pos.mul_f32(self.factor);
143-
self.input.try_seek(pos_accounting_for_speedup)
142+
self.input.try_seek(pos)
144143
}
145144
}

0 commit comments

Comments
 (0)