aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-29 11:24:30 +0200
committerDavid Robillard <d@drobilla.net>2018-11-10 11:45:15 +0100
commit677b06dfc2d8a8b361572d1dbee9c763823f8e9b (patch)
tree7341793e3501cd5461f67aa39a59416e569f1bf1
parent663506bcc2ce237c2bd42d1aa24a3d47d60393b6 (diff)
downloadjalv-677b06dfc2d8a8b361572d1dbee9c763823f8e9b.tar.gz
jalv-677b06dfc2d8a8b361572d1dbee9c763823f8e9b.tar.bz2
jalv-677b06dfc2d8a8b361572d1dbee9c763823f8e9b.zip
Separate Jack client creation from backend initialisation
-rw-r--r--src/jack.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/jack.c b/src/jack.c
index f85490a..f2ced50 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -313,8 +313,8 @@ jack_session_cb(jack_session_event_t* event, void* arg)
}
#endif /* JALV_JACK_SESSION */
-JalvBackend*
-jalv_backend_init(Jalv* jalv)
+static jack_client_t*
+jack_create_client(Jalv* jalv)
{
jack_client_t* client = NULL;
@@ -355,6 +355,16 @@ jalv_backend_init(Jalv* jalv)
}
free(jack_name);
+
+ return client;
+}
+
+JalvBackend*
+jalv_backend_init(Jalv* jalv)
+{
+ jack_client_t* const client =
+ jalv->backend ? jalv->backend->client : jack_create_client(jalv);
+
if (!client) {
return NULL;
}