Skip to content
Snippets Groups Projects
Commit 641fc56b authored by Adrien Béraud's avatar Adrien Béraud
Browse files

audio player: don't block in audio callback

Change-Id: I631d7ff419d5e2c1fa33923cc941413e498b951f
parent a042a02e
No related branches found
No related tags found
No related merge requests found
......@@ -41,10 +41,13 @@ bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* ctx)
{
(static_cast<AudioPlayer*>(ctx))->processSLCallback(bq);
}
void
AudioPlayer::processSLCallback(SLAndroidSimpleBufferQueueItf bq)
{
std::lock_guard<std::mutex> lk(m_);
std::unique_lock<std::mutex> lk(m_, std::defer_lock);
if (!lk.try_lock())
return;
// retrieve the finished device buf and put onto the free queue
// so recorder could re-use it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment