Skip to content
Permalink
Browse files

Merge PR #3490: JackAudio: change disconnect_ports() so that it uses …

…stored ports instead of retrieving them using jack_get_ports()
  • Loading branch information...
davidebeatrici committed Aug 2, 2018
2 parents 7c08da0 + 84f3488 commit d3cf441c238f97bae017f500a6b883f7674fb379
Showing with 13 additions and 12 deletions.
  1. +13 −12 src/mumble/JackAudio.cpp
@@ -252,20 +252,21 @@ void JackAudioSystem::disconnect_ports() {
return;
}

const char **ports = jack_get_ports(client, 0, "audio", JackPortIsPhysical);
// Disconnect the input port
if (in_port != NULL) {
int err = jack_port_disconnect(client, in_port);
if (err != 0) {
qWarning("JackAudioSystem: unable to disconnect in port - jack_port_disconnect() returned %i", err);
}
}

if (ports != NULL) {
int i = 0;
while (ports[i] != NULL) {
jack_port_t * const port = jack_port_by_name(client, ports[i]);
if (port == NULL) {
qWarning("JackAudioSystem: jack_port_by_name() returned an invalid port - skipping it");
continue;
// Disconnect the output ports
for (unsigned int i = 0; i < iOutPorts; ++i) {
if (out_ports[i] != NULL) {
int err = jack_port_disconnect(client, out_ports[i]);
if (err != 0) {
qWarning("JackAudioSystem: unable to disconnect out port - jack_port_disconnect() returned %i", err);
}

jack_port_disconnect(client, port);

++i;
}
}
}

0 comments on commit d3cf441

Please sign in to comment.
You can’t perform that action at this time.