diff --git a/crates/qbz-media-controls/src/linux.rs b/crates/qbz-media-controls/src/linux.rs index a7c48f714..7fabf7249 100644 --- a/crates/qbz-media-controls/src/linux.rs +++ b/crates/qbz-media-controls/src/linux.rs @@ -43,7 +43,16 @@ struct State { metadata: Metadata, status: MprisStatus, volume: Volume, + /// The last position we were TOLD, and when we were told it. + /// + /// MPRIS `Position` is read on demand, so what matters is the answer at + /// READ time, not at push time. Storing the instant alongside lets the + /// getter extrapolate — `position + (now - stamped)` while Playing — which + /// is exact to the microsecond no matter how often the app pushes. Without + /// it the answer is only as fresh as the last push, and the app would have + /// to choose between a stale clock and a faster poll it does not want. position: Time, + stamped: std::time::Instant, } /// Update commands sent from the app to the server thread. @@ -255,7 +264,15 @@ impl PlayerInterface for QbzMpris { Ok(()) } async fn position(&self) -> fdo::Result