aboutsummaryrefslogtreecommitdiffstats
path: root/src/jack.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-17 17:23:35 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:07:01 -0500
commit7c2472c6681467ad5afc33bc65cf5fe3d8a8a9d7 (patch)
tree7b71ee9f92673e930614d12191697e8f2d659ff6 /src/jack.c
parentffc643c1c5f23a5c993c30bf72363dc9567aa65a (diff)
downloadjalv-7c2472c6681467ad5afc33bc65cf5fe3d8a8a9d7.tar.gz
jalv-7c2472c6681467ad5afc33bc65cf5fe3d8a8a9d7.tar.bz2
jalv-7c2472c6681467ad5afc33bc65cf5fe3d8a8a9d7.zip
Factor out jalv_activate() and jalv_deactivate()
Further breaks up the monster jalv_open() and adds symmetric activate/deactivate functions that can be used to repeatedly start and stop audio processing (although this ability isn't currently used).
Diffstat (limited to 'src/jack.c')
-rw-r--r--src/jack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jack.c b/src/jack.c
index d261dc6..8b4dc25 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -404,7 +404,7 @@ jalv_backend_activate(Jalv* jalv)
void
jalv_backend_deactivate(Jalv* jalv)
{
- if (jalv->backend && !jalv->backend->is_internal_client) {
+ if (!jalv->backend->is_internal_client) {
jack_deactivate(jalv->backend->client);
}
}
@@ -551,6 +551,8 @@ jack_initialize(jack_client_t* const client, const char* const load_init)
if (err || (err = jalv_open(jalv, &argc, &argv))) {
jalv_close(jalv);
free(jalv);
+ } else {
+ jalv_activate(jalv);
}
free(argv);
@@ -566,6 +568,7 @@ jack_finish(void* const arg)
{
Jalv* const jalv = (Jalv*)arg;
if (jalv) {
+ jalv_deactivate(jalv);
if (jalv_close(jalv)) {
jalv_log(JALV_LOG_ERR, "Failed to close Jalv\n");
}