Skip to content

✨ feat: 为 ffmpeg 解码器添加流式解码功能#766

Merged
imsyy merged 5 commits into
SPlayer-Dev:devfrom
apoint123:feat/stream-decoding-for-ffmpeg
Jan 25, 2026
Merged

✨ feat: 为 ffmpeg 解码器添加流式解码功能#766
imsyy merged 5 commits into
SPlayer-Dev:devfrom
apoint123:feat/stream-decoding-for-ffmpeg

Conversation

@apoint123
Copy link
Copy Markdown
Member

@apoint123 apoint123 commented Jan 24, 2026

同时还添加了倍速播放功能

由于流式播放是完全手动实现的,可能存在一些 bug,建议多测试一下

@gemini-code-assist

This comment was marked as outdated.

@apoint123 apoint123 marked this pull request as draft January 24, 2026 20:21
gemini-code-assist[bot]

This comment was marked as resolved.

@apoint123 apoint123 force-pushed the feat/stream-decoding-for-ffmpeg branch from d1d7d66 to edcb679 Compare January 25, 2026 06:19
@apoint123
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

这次的 PR 是一次非常出色的重构,为 FFmpeg 解码器成功添加了流式解码和倍速播放功能。代码结构和质量都有了显著提升:

  • 架构升级: FFmpegAudioPlayer 被完全重写,通过 SharedArrayBufferAtomics 实现了高效的流式处理,这是一个复杂但实现得非常好的方案。
  • 代码质量: 引入了 TypedEventTarget,大大增强了事件系统的类型安全性和代码可读性。requestWorker 模式让与 Worker 的异步通信变得清晰可靠。
  • 用户体验: 在设置中为 FFmpeg 引擎增加了环境检查和友好的提示,提升了可用性。
  • 健壮性: 错误处理和时间同步机制都得到了加强,使得播放器更加稳定。

我发现了一些可以改进的小地方,主要集中在代码可读性和性能方面,具体请看我的评论。总体来说,这是一次高质量的提交!

Comment thread src/core/audio-player/ffmpeg-engine/FFmpegAudioPlayer.ts Outdated
Comment thread src/core/audio-player/ffmpeg-engine/FFmpegAudioPlayer.ts Outdated
Comment thread src/core/audio-player/ffmpeg-engine/ffmpeg.worker.ts
🦄 refactor: 优化错误处理
@apoint123 apoint123 marked this pull request as ready for review January 25, 2026 07:27
@imsyy imsyy merged commit 3a3c361 into SPlayer-Dev:dev Jan 25, 2026
@apoint123 apoint123 deleted the feat/stream-decoding-for-ffmpeg branch February 8, 2026 08:17
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.

2 participants