From 2c95f1a00ec68de522fc8767cf32690b0f8fab35 Mon Sep 17 00:00:00 2001 From: taro Date: Thu, 5 Sep 2024 02:53:47 -0300 Subject: [PATCH] Optimistic update to controls.position in try_seek --- src/sink.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sink.rs b/src/sink.rs index 2de077d..59d2fab 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -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.