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

OpenSL: limit waiting for playback

Prevent deadlock by stop waiting on the
condition variable after a second.

Change-Id: If707fac389615333d1074b0973d693a84c9a974e
parent 59d7779b
Branches
No related tags found
No related merge requests found
......@@ -281,7 +281,7 @@ OpenSLLayer::startAudioPlayback()
playThread = std::thread([&]() {
std::unique_lock<std::mutex> lck(playMtx);
while (player_ || ringtone_) {
playCv.wait(lck);
playCv.wait_for(lck, std::chrono::seconds(1));
if (player_ && player_->waiting_) {
std::lock_guard<std::mutex> lk(player_->m_);
engineServicePlay(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment