Allow UI to set video output but keep gpu-next in the list

This commit is contained in:
Vladimir Borisov 2025-08-01 12:04:25 +03:00
parent 8a943c9b12
commit e04cf5f0c4
No known key found for this signature in database
GPG key ID: F9A584BE4FCB6603
2 changed files with 12 additions and 1 deletions

View file

@ -185,7 +185,7 @@ pub enum StrProp {
SubColor,
TrackList,
VideoParams,
// Vo,
Vo,
}
stringable!(StrProp);

View file

@ -76,6 +76,7 @@ fn create_shareable_mpv(window_handle: HWND) -> Arc<Mpv> {
set_property!("msg-level", "all=no");
set_property!("quiet", "yes");
set_property!("hwdec", "auto");
// set_property!("vo", "gpu-next,");
Ok(())
});
Arc::new(mpv.expect("cannot build MPV"))
@ -228,6 +229,16 @@ fn create_message_thread(
set_property(name, value, &mpv);
}
InMsg(InMsgFn::MpvSetProp, InMsgArgs::StProp(name, PropVal::Str(value))) => {
let value = if name.to_string() == "vo" {
let mut value = value;
if !value.is_empty() && !value.ends_with(',') {
value.push(',');
}
value.push_str("gpu-next,");
value
} else {
value
};
set_property(name, value, &mpv);
}
InMsg(InMsgFn::MpvCommand, InMsgArgs::Cmd(cmd)) => {