Skip to content

Commit

Permalink
[更新MpvPlayer初始化代码]: 调整MpvPlayer类的initMpv方法,增加了对"wid"属性设置的判断逻辑,确保在特定条件…
Browse files Browse the repository at this point in the history
…下使用默认视频输出模块"libmpv"。

- 修复了在某些情况下,MpvPlayer可能无法正确设置窗口ID的问题。
- 增加了对"vo"选项的设置,以确保在窗口ID无效时,能够回退到默认的视频输出模块。
  • Loading branch information
RealChuan committed Jun 21, 2024
1 parent c21bfb4 commit 618c578
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mpv/mpvplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ void MpvPlayer::initMpv(QWidget *widget)
int64_t wid = raw_wid;
#endif
mpv_set_property(d_ptr->mpv, "wid", MPV_FORMAT_INT64, &wid);
} else {
mpv_set_option_string(d_ptr->mpv, "vo", "libmpv");
}
// Enable default bindings, because we're lazy. Normally, a player using
// mpv as backend would implement its own key bindings.
Expand Down

0 comments on commit 618c578

Please sign in to comment.