Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions crates/rendering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ pub struct RecordingSegmentDecoders {
pub segment_offset: f64,
}

const SCREEN_MAX_FALLBACK_DISTANCE: u32 = 4;
const CAMERA_MAX_FALLBACK_DISTANCE: u32 = 2;

pub struct SegmentVideoPaths {
Expand Down Expand Up @@ -328,6 +327,11 @@ impl RecordingSegmentDecoders {
};

let screen_future = async {
// Screen capture is change-driven (WGC delivers nothing while the
// screen is static), so the nearest decoded frame is routinely many
Comment on lines +330 to +331

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we expand/avoid the WGC acronym in this comment so it’s clear without Windows context?

Suggested change
// Screen capture is change-driven (WGC delivers nothing while the
// screen is static), so the nearest decoded frame is routinely many
// Screen capture is change-driven (Windows Graphics Capture (WGC) delivers nothing
// while the screen is static), so the nearest decoded frame is routinely many

// frame-times away from the requested time and is still the right
// content. Keep the default (wide) fallback distance; a tight cap
// here blanks the preview during static stretches.
spawn_decoder(
"screen",
display_path,
Expand All @@ -336,7 +340,6 @@ impl RecordingSegmentDecoders {
force_ffmpeg,
)
.await
.map(|decoder| decoder.with_max_fallback_distance(SCREEN_MAX_FALLBACK_DISTANCE))
.map_err(|e| format!("Screen:{e}"))
Comment on lines 342 to 343

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor maintainability thought: this relies on the decoder’s default fallback distance (currently 90). If that default ever changes again, this regression could come back; consider making the screen value explicit here.

Suggested change
.await
.map(|decoder| decoder.with_max_fallback_distance(SCREEN_MAX_FALLBACK_DISTANCE))
.map_err(|e| format!("Screen:{e}"))
.await
.map(|decoder| decoder.with_max_fallback_distance(90))
.map_err(|e| format!("Screen:{e}"))

};

Expand Down
Loading