summaryrefslogtreecommitdiffstats
path: root/audio/manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/manager.c')
-rw-r--r--audio/manager.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/audio/manager.c b/audio/manager.c
index 931af069..1c8970d1 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -1634,7 +1634,6 @@ static void server_exit(void)
int audio_init(DBusConnection *conn, GKeyFile *config)
{
- int sinks, sources;
char *str;
GError *err = NULL;
@@ -1693,29 +1692,10 @@ int audio_init(DBusConnection *conn, GKeyFile *config)
goto failed;
}
- if (enabled.sink) {
- if (config) {
- str = g_key_file_get_string(config, "A2DP",
- "SourceCount", &err);
- if (err) {
- debug("audio.conf: %s", err->message);
- g_error_free(err);
- err = NULL;
- } else {
- sources = atoi(str);
- g_free(str);
- }
- }
- } else
- sources = 0;
-
- if (enabled.source)
- sinks = 1;
- else
- sinks = 0;
-
- if (a2dp_init(conn, sources, sinks) < 0)
- goto failed;
+ if (enabled.source || enabled.sink) {
+ if (a2dp_init(conn, config) < 0)
+ goto failed;
+ }
if (enabled.control && avrcp_init(conn) < 0)
goto failed;