static int audio_init(void) { GKeyFile *config; config = load_config_file(CONFIGDIR "/audio.conf"); if (audio_manager_init(config) < 0) { audio_manager_exit(); return -EIO; } return 0; }
static void audio_exit(void) { if (sco_server) { g_io_channel_shutdown(sco_server, TRUE, NULL); g_io_channel_unref(sco_server); sco_server = NULL; } audio_manager_exit(); unix_exit(); dbus_connection_unref(connection); }
static int audio_init(void) { GKeyFile *config; gboolean enable_sco; connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); if (connection == NULL) return -EIO; config = load_config_file(CONFIGDIR "/audio.conf"); if (unix_init() < 0) { error("Unable to setup unix socket"); goto failed; } if (audio_manager_init(connection, config, &enable_sco) < 0) goto failed; if (!enable_sco) return 0; sco_server = bt_io_listen(BT_IO_SCO, sco_server_cb, NULL, NULL, NULL, NULL, BT_IO_OPT_INVALID); if (!sco_server) { error("Unable to start SCO server socket"); goto failed; } return 0; failed: audio_manager_exit(); unix_exit(); if (connection) { dbus_connection_unref(connection); connection = NULL; } return -EIO; }
static void audio_exit(void) { audio_manager_exit(); }