Merge pull request #608 from lautarodragan/master

Optimistic update to controls.position in try_seek
This commit is contained in:
David Kleingeld 2024-09-05 17:58:19 +02:00 committed by GitHub
commit 6bfd840de6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -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`

View file

@ -238,7 +238,10 @@ impl Sink {
}
match feedback.recv() {
Ok(seek_res) => seek_res,
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.