diff options
Diffstat (limited to 'alc/backends/jack.cpp')
-rw-r--r-- | alc/backends/jack.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp index 42509d77..cf52e7a4 100644 --- a/alc/backends/jack.cpp +++ b/alc/backends/jack.cpp @@ -384,22 +384,23 @@ int JackPlayback::mixerProc() void JackPlayback::open(const char *name) { - mPortPattern.clear(); - - const PathNamePair &binname = GetProcBinary(); - const char *client_name{binname.fname.empty() ? "alsoft" : binname.fname.c_str()}; - - jack_status_t status; - mClient = jack_client_open(client_name, ClientOptions, &status, nullptr); - if(mClient == nullptr) - throw al::backend_exception{al::backend_error::DeviceError, - "Failed to open client connection: 0x%02x", status}; - if((status&JackServerStarted)) - TRACE("JACK server started\n"); - if((status&JackNameNotUnique)) + if(!mClient) { - client_name = jack_get_client_name(mClient); - TRACE("Client name not unique, got '%s' instead\n", client_name); + const PathNamePair &binname = GetProcBinary(); + const char *client_name{binname.fname.empty() ? "alsoft" : binname.fname.c_str()}; + + jack_status_t status; + mClient = jack_client_open(client_name, ClientOptions, &status, nullptr); + if(mClient == nullptr) + throw al::backend_exception{al::backend_error::DeviceError, + "Failed to open client connection: 0x%02x", status}; + if((status&JackServerStarted)) + TRACE("JACK server started\n"); + if((status&JackNameNotUnique)) + { + client_name = jack_get_client_name(mClient); + TRACE("Client name not unique, got '%s' instead\n", client_name); + } } if(PlaybackList.empty()) |