Skip to content

Commit 618c578

Browse files
committed
[更新MpvPlayer初始化代码]: 调整MpvPlayer类的initMpv方法,增加了对"wid"属性设置的判断逻辑,确保在特定条件下使用默认视频输出模块"libmpv"。
- 修复了在某些情况下,MpvPlayer可能无法正确设置窗口ID的问题。 - 增加了对"vo"选项的设置,以确保在窗口ID无效时,能够回退到默认的视频输出模块。
1 parent c21bfb4 commit 618c578

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mpv/mpvplayer.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ void MpvPlayer::initMpv(QWidget *widget)
624624
int64_t wid = raw_wid;
625625
#endif
626626
mpv_set_property(d_ptr->mpv, "wid", MPV_FORMAT_INT64, &wid);
627+
} else {
628+
mpv_set_option_string(d_ptr->mpv, "vo", "libmpv");
627629
}
628630
// Enable default bindings, because we're lazy. Normally, a player using
629631
// mpv as backend would implement its own key bindings.

0 commit comments

Comments
 (0)