JACK: fix race condition with decode thread

It was possible for the JACK callback to execute before the decode thread had
been started, causing an assertion.
This commit is contained in:
Devin J. Pohly
2013-08-20 09:33:35 -04:00
parent dcb5087b1b
commit 2933a71d5d
+3 -1
View File
@@ -34,6 +34,9 @@ RString RageSoundDriver_JACK::Init()
sample_rate = jack_get_sample_rate(client);
LOG->Trace("JACK connected at %u Hz", sample_rate);
// Start this before callbacks
StartDecodeThread();
// Set callback for processing audio
if (jack_set_process_callback(client, ProcessTrampoline, this))
{
@@ -83,7 +86,6 @@ RString RageSoundDriver_JACK::Init()
goto out_deactivate;
// Success!
StartDecodeThread();
LOG->Trace("JACK sound driver started successfully");
return RString();