Skip to content
Snippets Groups Projects
Commit 410599d0 authored by Emmanuel Lepage Vallée's avatar Emmanuel Lepage Vallée Committed by Guillaume Roguez
Browse files

alsa: Prevent SEGFAULT if initialization failed


When calling from the first time and being unable to get the alsa
lock, dring would behave normally.

However, on the second try, it would crash.

Change-Id: I47c4e68f5111c29f356bde88723a585fe34d1a0d
Signed-off-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 38c9874b
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,7 @@ bool AlsaLayer::openDevice(snd_pcm_t **pcm, const std::string &dev, snd_pcm_stre
if (err == -EBUSY) {
// We're called in audioThread_ context, so if exit is requested
// force return now
if (not audioThread_->isRunning())
if ((not audioThread_) or (not audioThread_->isRunning()))
return false;
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment