Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing almost infinity loop in FillSilence for wrong bytes length #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kareljuricka
Copy link
Contributor

@kareljuricka kareljuricka commented Nov 25, 2020

In reaction on my issue #175, I found fix:

During debugging reason of app crashing during another load of manifest when audio from previous manifest hasn't start playing, I found out that time = player_->CurrentTime() is returning 0.
Later function GetSyncBytes returns wrong big number, because (buffer_end - next->pts) in GetSyncBytes is deducting:
0 - SECONDS.
This cause that function FillSilence in audio_renderer_common start to loop on huge bytes size and ends almost in infinity loop. Results is app crash on device or memory pressure on simulator like it was described in issue #175.

I think that after clock_->SleepSeconds(delay) there should be check on player status in same way as on each thread loop start. Additionally, there has to be std::unique_lock<Mutex> lock(mutex_) to lock mutex which was unlocked before sleep.
If there is no check, time = player_->CurrentTime() returns 0 after sleep in specific situation.

Fixes #175

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.

The player crashes when calling load() before audio plays from previous load()
1 participant