bluetooth: Do not setup stream before thread starts

bt_transport_acquire() might get called from the main thread, in case
the IO thread hasn't been started yet. In this case, we should not call
setup_stream() since this is going to be called in the beginning of
thread_func().
This commit is contained in:
Mikel Astiz 2012-12-03 11:03:58 +01:00 committed by Tanu Kaskinen
parent 1dcdb96ee5
commit 01435e6134

View file

@ -426,6 +426,10 @@ static int bt_transport_acquire(struct userdata *u, pa_bool_t start) {
return 0;
done:
/* If thread is still about to start, the stream will be set up in the beginning of thread_func() */
if (u->thread == NULL)
return 0;
setup_stream(u);
return 0;