Skip to content

fix(streaming): recover RTSP host resolution - #93

Merged
qiin2333 merged 1 commit into
masterfrom
codex/fix-rtsp-host-resolution
Jul 29, 2026
Merged

fix(streaming): recover RTSP host resolution#93
qiin2333 merged 1 commit into
masterfrom
codex/fix-rtsp-host-resolution

Conversation

@qiin2333

@qiin2333 qiin2333 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

改了啥呀

  • 从 Sunshine 返回的 sessionUrl0 提取 RTSP 主机,兼容 IPv4、带方括号 IPv6 和 rtspenc://
  • 记录 native 连接失败阶段
  • 仅当返回 -2 且失败于名称解析阶段时,停止旧连接并用 sessionUrl0 主机重试一次
  • 后续瞬态网络重试继续沿用已经生效的地址

为啥要这样

日志里 Sunshine 已完成 launch、虚拟显示器与编码器准备,但鸿蒙端在发出 RTSP DESCRIBE 前就以 -2 结束;Qt 客户端连接一次后鸿蒙又恢复,符合所选 hostname 在 launch/resume 后解析失效的表现。

不能无条件改用 sessionUrl0:公网 IPv4/NAT 场景里它可能是不可达的内网地址。所以只在“名称解析阶段 + -2”这个明确条件下回退,别让修复变成另一只杂鱼 bug 呀。

验证

  • npm run check(仓库检查、许可证检查、11 组 mock 连接测试)
  • DevEco Hvigor assembleApp 完整构建成功
  • git diff --check

Summary by CodeRabbit

  • 改进

    • 优化连接失败后的自动重试机制,可根据失败阶段智能切换至 RTSP 会话实际提供的主机地址。
    • 在启动返回瞬态错误时,重试将继续使用当前有效连接地址,提升连接稳定性。
  • 自检

    • 增加对 RTSP、RTSP over TLS 及 IPv4/IPv6 地址解析的启动期检查。
    • 非 RTSP 地址将被正确识别并跳过解析。

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 63afe0ae-bf03-4d76-8653-874c22e5be4d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qiin2333
qiin2333 marked this pull request as ready for review July 29, 2026 10:23
@qiin2333
qiin2333 merged commit 87d0da9 into master Jul 29, 2026
2 checks passed
@qiin2333
qiin2333 deleted the codex/fix-rtsp-host-resolution branch July 29, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant