We shouldn't be passing the main loop object to the pa_context while
that loop is running and not locked. Push the main loop startup after we
created the main loop.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
if (!p->mainloop)
goto fail;
- if (pa_threaded_mainloop_start(p->mainloop) < 0)
- goto fail;
-
if (pa_get_binary_name(proc, sizeof(proc)))
snprintf(buf, sizeof(buf), "ALSA plug-in [%s]",
pa_path_get_filename(proc));
pa_context_set_state_callback(p->context, context_state_cb, p);
+ if (pa_threaded_mainloop_start(p->mainloop) < 0)
+ goto fail;
+
return p;
fail: