From eb5b96122f7bde266b1e82dfd3821e06dbffafd4 Mon Sep 17 00:00:00 2001 From: KhooLy <73142442+KhooLy@users.noreply.github.com> Date: Sat, 20 Jun 2026 16:28:38 +0300 Subject: [PATCH] fix: don't fail player init when mpv lacks the osc option Found via the new debug_log checkpoints: the bundled Linux libmpv was built without lua, so mpv_set_option_string("osc", "no") returned "option not found" and player_init bailed out entirely before ever creating a renderer. We only set this to turn OSC off, which is moot if OSC doesn't exist in the first place, so treat it as a warning instead of a fatal error. --- src-tauri/src/mpv_render.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/mpv_render.rs b/src-tauri/src/mpv_render.rs index dc1eb2e..f8bfc3f 100644 --- a/src-tauri/src/mpv_render.rs +++ b/src-tauri/src/mpv_render.rs @@ -325,7 +325,9 @@ impl MpvRenderer { renderer.set_option("vo", "libmpv")?; renderer.set_option("idle", "yes")?; renderer.set_option("keep-open", "yes")?; - renderer.set_option("osc", "no")?; + if let Err(error) = renderer.set_option("osc", "no") { + log::warn!("set_option(osc, no) failed (mpv build without lua/OSC?): {error}"); + } renderer.set_option("osd-level", "0")?; renderer.set_option("osd-bar", "no")?; renderer.set_option("input-default-bindings", "yes")?; @@ -393,7 +395,9 @@ impl MpvRenderer { renderer.set_option("ao", "null")?; renderer.set_option("audio", "no")?; renderer.set_option("idle", "yes")?; - renderer.set_option("osc", "no")?; + if let Err(error) = renderer.set_option("osc", "no") { + log::warn!("set_option(osc, no) failed (mpv build without lua/OSC?): {error}"); + } renderer.set_option("osd-level", "0")?; renderer.set_option("hr-seek", "yes")?; renderer.set_option("pause", "yes")?;