Skip to content

refactor: 使用来自 ffmpeg_audio 的 HTTP 播放源实现 - #133

Merged
imsyy merged 3 commits into
devfrom
refactor/use-ffmpeg-audio-http-impl
Aug 5, 2026
Merged

imsyy merged 3 commits into
devfrom
refactor/use-ffmpeg-audio-http-impl

Conversation

@apoint123

Copy link
Copy Markdown
Member

改动类型

  • 新功能(feat)
  • 缺陷修复(fix)
  • 重构 / 优化(不改变对外行为)
  • 文档(docs)
  • 其他(请在「改动说明」中注明)

是否包含破坏性变更

  • 是(请在「改动说明」中详细描述)
  • 否

改动说明

使用来自 ffmpeg-audio 的 HTTP 音频源实现,不重复造轮子

测试情况

在 Windows 上进行了充分的测试,包括频繁 Seek、切歌等

自查清单

  • 本 PR 只包含一个主要功能 / 修复,没有夹带无关改动
  • 已在本地完整测试通过;AI 生成的代码同样自行测试并审阅过,未做未经验证的提交
  • 已运行 pnpm format,并确认 pnpm typecheck、pnpm lint 通过
  • 改动涉及原生模块时已 pnpm build:native 验证;未手写 native/*/index.d.ts
  • 已向 dev 分支提交

Copilot AI balanced review requested due to automatic review settings August 5, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

将音频引擎的自研 HTTP Range 源替换为 ffmpeg_audio 提供的实现。

Changes:

  • 升级 ffmpeg_audio 至 0.3.0 并启用 HTTP、tracing。
  • 接入 HttpAudioSource 与 HttpCancelHandle,删除原实现。
  • 同步依赖锁文件及架构文档。

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
native/audio-engine/src/shared.rs 管理新的取消句柄
native/audio-engine/src/player.rs 调整加载、停止取消流程
native/audio-engine/src/lib.rs 创建并传递取消句柄
native/audio-engine/src/http_source.rs 删除自研 HTTP 源
native/audio-engine/src/decoder.rs 接入上游 HTTP 音频源
native/audio-engine/Cargo.toml 升级并配置依赖
Cargo.lock 更新 Rust 依赖锁定
docs/native.md 更新原生模块文档
CLAUDE.md 更新架构说明
AGENTS.md 更新代理开发指引
.github/copilot-instructions.md 更新 Copilot 项目说明

Comment thread native/audio-engine/src/decoder.rs Resolved
Copilot AI review requested due to automatic review settings August 5, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

native/audio-engine/Cargo.toml:15

  • 建议:删除自研 http_source 后,项目源码已不再直接使用 tokio-util,测试也不再使用 httpmock,但两项仍保留在本文件第 40、50 行。请一并移除这些失效的直接依赖,避免继续维护并在测试构建中编译无用依赖。
ffmpeg_audio = { version = "0.3.1", default-features = false, features = [
  "http",
  "tracing",
] }

Comment thread native/audio-engine/src/decoder.rs Resolved
Copilot AI review requested due to automatic review settings August 5, 2026 11:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Comment on lines +649 to +651
if let Some(h) = self.pending_load_handle.take() {
h.cancel();
}
@imsyy
imsyy merged commit b421739 into dev Aug 5, 2026
8 of 9 checks passed
@apoint123
apoint123 deleted the refactor/use-ffmpeg-audio-http-impl branch August 5, 2026 13:42
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.

3 participants