fix(vdd): harden restore capture startup#707
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Summary by CodeRabbit发布说明
Walkthrough本PR在VDD设备初始化中引入两项改动:为硬件光标设置新增 XML 持久化函数并在禁用流程中集成重试持久化;重构 Windows 端监视器索引探测以仅在探测到精确分辨率匹配时返回索引,并改进诊断日志。 变更VDD硬件光标持久化
VDD监视器索引精确匹配探测
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Infer (1.2.0)src/display_device/vdd_utils.cppIn file included from src/display_device/vdd_utils.cpp:3: ... [truncated 2200 characters] ... gFrontend__CTrans.CTrans_funct.instruction_log.(fun) in file "src/clang/cTrans.ml", line 4784, characters 10-1023 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/display_device/vdd_utils.cpp`:
- Line 356: The call to persist_hardware_cursor_setting(false) ignores its
return value so disk-write failures are treated as success; modify the caller to
check the function's boolean/errno-style result from
persist_hardware_cursor_setting and handle failures: if it fails, log an error
(including the failure code/message), abort or return an error status from the
current function instead of continuing, and/or perform a retry/backoff path so
the "persist" step cannot silently fail and lead to repeated mis-detection on
restart; update the enclosing function to propagate the failure to callers (or
trigger a safe fallback) so the system does not assume the setting was persisted
when it wasn't.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3832d18c-d26a-47e1-b2fc-8b0e31d645d9
📒 Files selected for processing (2)
src/display_device/vdd_utils.cppsrc/platform/windows/display_vdd.cpp
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Windows
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.{cpp,c,h}
⚙️ CodeRabbit configuration file
src/**/*.{cpp,c,h}: Sunshine 核心 C++ 源码,自托管游戏串流服务器。审查要点:内存安全、 线程安全、RAII 资源管理、安全漏洞。注意预处理宏控制的平台相关代码。
Files:
src/display_device/vdd_utils.cppsrc/platform/windows/display_vdd.cpp
src/platform/**
⚙️ CodeRabbit configuration file
src/platform/**: 平台抽象层代码(Windows/Linux/macOS)。确保各平台实现一致, 注意 Windows API 调用的错误处理和资源释放。
Files:
src/platform/windows/display_vdd.cpp
🔇 Additional comments (5)
src/display_device/vdd_utils.cpp (1)
20-20: LGTM!Also applies to: 299-319, 1019-1019
src/platform/windows/display_vdd.cpp (4)
269-275: LGTM!
277-312: LGTM!
326-359: LGTM!
320-321: 💤 Low value确认
2500ms/100ms的字面量运算符在platf::dxgi作用域内可见(src/platform/windows/display_vdd.cpp:namespace platf { using namespace std::literals; }在第 28-30 行,resolve_vdd_monitor_index在namespace platf::dxgi内第 32 行起)。std::literals本身覆盖 chrono UDL,因此无需额外std::chrono_literals或担心该作用域不可达。
|
@coderabbitai review |
✅ Action performedReview finished.
|
改了啥呀
HardwareCursor关掉;这次把成功关闭后的状态同步写回vdd_settings.xml,避免恢复串流时反复误判、反复让驱动 reload。为啥要改
日志里恢复串流前 VDD 还在,但
HardwareCursor false又触发了一次驱动 reload,VDD monitor 随后掉线并被重建。改编码格式后黑屏那段也显示会话/编码器目标是 3168x1440,但 VDD producer 仍发布 3440x1440,旧逻辑 fallback 到这个 stale producer 后一直 reinit。杂鱼状态别再冒充可用了喂。验证
git diff --check -- src/display_device/vdd_utils.cpp src/platform/windows/display_vdd.cppcmake --build build --target sunshine,但当前本地 MSYS2 toolchain 阻塞:C:\msys64\ucrt64\bin\c++.exe连空的单文件编译也无诊断返回 1,因此完整构建未能在本机完成。