Use global init/cleanup function

This commit is contained in:
Andreas Eversberg
2017-01-13 07:28:31 +01:00
parent bc028cd4d3
commit 2d8d7e62c1
9 changed files with 83 additions and 101 deletions

View File

@@ -166,20 +166,11 @@ int main(int argc, char *argv[])
print_image();
/* init functions */
if (use_mncc_sock) {
rc = mncc_init("/tmp/bsc_mncc");
if (rc < 0) {
fprintf(stderr, "Failed to setup MNCC socket. Quitting!\n");
return -1;
}
}
rc = init_common(station_id, 5);
if (rc < 0)
goto fail;
dsp_init();
anetz_init();
rc = call_init(station_id, call_audiodev, samplerate, latency, 5, loopback);
if (rc < 0) {
fprintf(stderr, "Failed to create call control instance. Quitting!\n");
goto fail;
}
/* create transceiver instance */
for (i = 0; i < num_kanal; i++) {
@@ -195,9 +186,7 @@ int main(int argc, char *argv[])
fail:
/* cleanup functions */
call_cleanup();
if (use_mncc_sock)
mncc_exit();
cleanup_common();
/* destroy transceiver instance */
while (sender_head)