Commit 0269b3de authored by sletz's avatar sletz
Browse files

Improve handling of loopback driver.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4272 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 621db9bf
......@@ -191,7 +191,7 @@ int main(int argc, char* argv[])
const JSList * server_parameters;
const char* server_name = "default";
jackctl_driver_t * master_driver_ctl;
jackctl_driver_t * loopback_driver_ctl;
jackctl_driver_t * loopback_driver_ctl = NULL;
int replace_registry = 0;
const char *options = "-d:X:I:P:uvshVrRL:STFl:t:mn:p:"
......@@ -486,7 +486,6 @@ int main(int argc, char* argv[])
if (loopback > 0) {
loopback_driver_ctl = jackctl_server_get_driver(server_ctl, "loopback");
// XX: What if this fails?
if (loopback_driver_ctl != NULL) {
const JSList * loopback_parameters = jackctl_driver_get_parameters(loopback_driver_ctl);
param = jackctl_get_parameter(loopback_parameters, "channels");
......@@ -498,8 +497,10 @@ int main(int argc, char* argv[])
fprintf(stderr, "Driver \"loopback\" cannot be loaded\n");
goto close_server;
}
} else {
fprintf(stderr, "Driver \"loopback\" not found\n");
goto close_server;
}
}
// Start the server
......@@ -533,7 +534,7 @@ int main(int argc, char* argv[])
fprintf(stderr, "Cannot stop server...\n");
}
close_server:
if (loopback > 0) {
if (loopback > 0 && loopback_driver_ctl) {
jackctl_server_remove_slave(server_ctl, loopback_driver_ctl);
}
// Slave drivers
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment