🐞 fix: 修复延迟补偿在playback模式意外丢失补偿值的逻辑bug#991
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求旨在解决音频播放器中延迟补偿机制的两个关键逻辑错误。它通过根据当前的音频延迟提示模式( Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
此 PR 修复了与音频延迟补偿相关的逻辑错误。修改的核心是在 currentTime getter 中动态地从 settingStore 获取当前的 audioLatencyHint,以确保只在 playback 模式下应用自动和手动的延迟补偿。这解决了在 interactive 模式下补偿被错误应用,以及模式切换后自动补偿失效的问题。代码改动是正确的,但有一个性能相关的建议:为了避免在 currentTime 这个高频调用的函数中重复获取 store 实例,建议将其缓存。
playback模式下设置的audioDelayCompensation值被意外计算在interactive模式下,当audioDelayCompensation的值不为0时导致interactive模式歌词与歌词进度不一致;interactive切换到playback模式后,自动计算的延迟补偿被意外设定为0导致自动补偿失效。