Skip to content

Commit

Permalink
Add an option to not automatically connect ports on jack. (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
derekdreery committed Oct 19, 2020
1 parent a7e83aa commit c0adf04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions include/cubeb/cubeb.h
Expand Up @@ -242,6 +242,10 @@ typedef enum {
should persist across restarts of the stream
and/or application. May not be honored for
all backends and platforms. */

CUBEB_STREAM_PREF_JACK_NO_AUTO_CONNECT = 0x20 /**< Don't automatically try to connect
ports. Only affects the jack
backend. */
} cubeb_stream_prefs;

/** Stream format initialization parameters. */
Expand Down
10 changes: 6 additions & 4 deletions src/cubeb_jack.cpp
Expand Up @@ -907,10 +907,12 @@ cbjack_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_
}
}

if (cbjack_connect_ports(stm) != CUBEB_OK) {
pthread_mutex_unlock(&stm->mutex);
cbjack_stream_destroy(stm);
return CUBEB_ERROR;
if (!input_stream_params->prefs & CUBEB_STREAM_PREF_JACK_NO_AUTO_CONNECT) {
if (cbjack_connect_ports(stm) != CUBEB_OK) {
pthread_mutex_unlock(&stm->mutex);
cbjack_stream_destroy(stm);
return CUBEB_ERROR;
}
}

*stream = stm;
Expand Down

0 comments on commit c0adf04

Please sign in to comment.