Skip to content

Commit

Permalink
Optimistic update to controls.position in try_seek:
Browse files Browse the repository at this point in the history
- Add entry in CHANGELOG.md
- `cargo fmt`
  • Loading branch information
lautarodragan committed Sep 5, 2024
1 parent 2c95f1a commit 7fc5bd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`fade_in` has been refactored to use the `linear_gain_ramp`
implementation.

### Fixed
- `Sink.try_seek` now updates `controls.position` before returning. Calls to `Sink.get_pos`
done immediately after a seek will now return the correct value.

### Changed
- `SamplesBuffer` is now `Clone`

Expand Down
2 changes: 1 addition & 1 deletion src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl Sink {
Ok(seek_res) => {
*self.controls.position.lock().unwrap() = pos;
seek_res
},
}
// The feedback channel closed. Probably another seekorder was set
// invalidating this one and closing the feedback channel
// ... or the audio thread panicked.
Expand Down

0 comments on commit 7fc5bd0

Please sign in to comment.