Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
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