Skip to content

Commit cd330fe

Browse files
fix(video): annotate last_present type and record present time
The FPS pacer in the video playback loop compiled only by accident; `last_present` had no type annotation and was never assigned, so the `--max-fps` pacing never activated. Give it a concrete type and stamp it after each presented frame so the limit actually throttles.
1 parent d6d7774 commit cd330fe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎wallr-core/src/daemon/mod.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ fn play_video(
12531253
.max_fps
12541254
.filter(|fps| *fps > 0)
12551255
.map(|fps| std::time::Duration::from_secs_f64(1.0 / f64::from(fps)));
1256-
let mut last_present = None;
1256+
let mut last_present: Option<std::time::Instant> = None;
12571257
let mut warned_size_mismatch = false;
12581258

12591259
loop {
@@ -1336,7 +1336,9 @@ fn play_video(
13361336
);
13371337

13381338
match status.map(video_present_action) {
1339-
Ok(VideoPresentAction::Presented) => {}
1339+
Ok(VideoPresentAction::Presented) => {
1340+
last_present = Some(std::time::Instant::now());
1341+
}
13401342
Ok(action) => {
13411343
if action == VideoPresentAction::Reconfigure {
13421344
surface.configure(

0 commit comments

Comments
 (0)