screenshare: honor viewer settings for the VLC player too

The viewer playback settings (hardware decode + buffering) only shaped
mpv's argv; vlc_args() was fixed, so a VLC viewer silently ignored them.
The load-bearing case is hardware decode: mpv defaults to software decode
(the A-bug fix), but VLC hardware-decodes by default, so a VLC viewer with
the default hardware_decode=false still got GPU decode and could hit the
frame-1 freeze the default exists to avoid — the toggle did nothing.

vlc_args() now takes the settings and maps the knobs that translate
cleanly to VLC: hardware decode (--avcodec-hw=none/any) and buffering
posture (network/live caching ms). The genuinely mpv-specific knobs
(cache_mb byte-cache, extra_mpv_args) stay mpv-only; the Settings UI
hints are reworded to say which knobs are mpv-only vs universal. +2 tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-06 13:22:31 -04:00
co-authored by Claude Opus 4.8
parent e378b2e33b
commit faad8ce26a
2 changed files with 68 additions and 7 deletions
+3 -3
View File
@@ -3452,7 +3452,7 @@ fn share_player_hint(player: SharePlayer) -> &'static str {
fn share_buffering_hint(buffering: ShareBuffering) -> &'static str {
match buffering {
ShareBuffering::LowLatency => "Small buffers for interactive screen sharing.",
ShareBuffering::Smooth => "Larger mpv cache/readahead for steadier playback.",
ShareBuffering::Smooth => "Larger cache/readahead for steadier playback.",
}
}
@@ -5146,13 +5146,13 @@ fn view(state: &AppState) -> Element<'_, AppMessage> {
Some(screen_share.cache_mb),
AppMessage::ScreenShareCacheMbSelected,
).width(iced::Length::Fill),
text("Used as mpv demuxer cache size.").size(11).color(color_subtext),
text("mpv demuxer cache size (mpv only).").size(11).color(color_subtext),
].spacing(4).width(iced::Length::Fill),
column![
checkbox(screen_share.hardware_decode)
.label("Hardware video decode")
.on_toggle(AppMessage::ToggleScreenShareHardwareDecode),
text("Adds --hwdec=auto to mpv. Off avoids the known frame-freeze bug.").size(11).color(color_subtext),
text("GPU decode (mpv --hwdec=auto / VLC hardware decode). Off avoids the known frame-freeze bug.").size(11).color(color_subtext),
].spacing(8).width(iced::Length::Fill),
].spacing(16).width(iced::Length::Fill),
].spacing(10).width(iced::Length::Fill),