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

opensles: prevent crash in releaseBuffer() #863

Merged
merged 1 commit into from
May 20, 2020
Merged

Conversation

philburk
Copy link
Collaborator

Move call to getPosition() outside the callback.
This was triggering a restoreTrack_l() inside
AudioFlinger folowing a headset insertion.
That in turn caused an assert in releaseBuffer() in
AudioTrack or AudioRecord.

Now it is called when needed by getFramesRead() or getFramesWritten().

Fixes ##535

Move call to getPosition() outside the callback.
This was triggering a restoreTrack_l() inside
AudioFlinger folowing a headset insertion.
That in turn caused an assert in releaseBuffer() in
AudioTrack or AudioRecord.

Now it is called when needed by getFramesRead() or getFramesWritten().

Fixes ##535
@philburk philburk requested a review from dturner May 20, 2020 22:14
@philburk philburk merged commit d2430bf into master May 20, 2020
@philburk philburk deleted the workaroundsles branch May 20, 2020 23:35
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.

1 participant