Skip to content

fix regression issues#232

Merged
yoreland merged 3 commits into
masterfrom
dev/fixbug
Nov 3, 2021
Merged

fix regression issues#232
yoreland merged 3 commits into
masterfrom
dev/fixbug

Conversation

@yoreland
Copy link
Copy Markdown
Contributor

@yoreland yoreland commented Nov 2, 2021

No description provided.

@yoreland yoreland requested a review from oOJohn6Oo November 2, 2021 15:23
private void startProgressTimer() {
final int result = (int) ((float) engine.getAudioMixingCurrentPosition() / (float) engine.getAudioFileInfo(Constant.URL_PLAY_AUDIO_FILES) * 100);
mixingProgressBar.setProgress(Long.valueOf(result).intValue());
engine.getAudioFileInfo(Constant.URL_PLAY_AUDIO_FILES);
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.

  • 崩溃是因为此方法是由handler延迟执行,可能调用到这里engine = null,所以要加判空处理;
  • 另外因为音频时长是异步回调,这里最好判断下当前duration或者Slider.max是否为0,否则可能出现初次播放进度条直接到最后的情况。

上面说的在 Sep 27, 2021 NMS-714 这次提交是已经做了的。

public void onRequestAudioFileInfo(AudioFileInfo info, int error) {
Log.d(TAG, "onRequestAudioFileInfo: "+info.durationMs);
handler.post(()-> mixingProgressBar.setMax(info.durationMs));
if(info.durationMs > 0 && progressText.getText().equals("00:00")) {
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.

这里这个判断没有必要

@yoreland yoreland requested a review from oOJohn6Oo November 3, 2021 03:29
@yoreland yoreland merged commit e1213bf into master Nov 3, 2021
@yoreland yoreland deleted the dev/fixbug branch November 3, 2021 03:33
alienzh pushed a commit that referenced this pull request Feb 12, 2026
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