diff options
author | Richard Dodd (dodj) <[email protected]> | 2020-10-19 16:49:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-19 17:49:40 +0200 |
commit | c0adf049c22d995e4692bbbe573dfffbfbbdaf69 (patch) | |
tree | e159d2face3350de72303f577465b38bc98c098d | |
parent | a7e83aa2b1571b842a555158e8f25aeb1419ebd1 (diff) | |
download | cubeb-c0adf049c22d995e4692bbbe573dfffbfbbdaf69.tar.gz cubeb-c0adf049c22d995e4692bbbe573dfffbfbbdaf69.zip |
Add an option to not automatically connect ports on jack. (#613)
-rw-r--r-- | include/cubeb/cubeb.h | 4 | ||||
-rw-r--r-- | src/cubeb_jack.cpp | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/cubeb/cubeb.h b/include/cubeb/cubeb.h index 9b92bae..e88536f 100644 --- a/include/cubeb/cubeb.h +++ b/include/cubeb/cubeb.h @@ -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. */ diff --git a/src/cubeb_jack.cpp b/src/cubeb_jack.cpp index 96d96e6..5c15672 100644 --- a/src/cubeb_jack.cpp +++ b/src/cubeb_jack.cpp @@ -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; |