summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-27 14:36:05 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-27 14:36:05 +0000
commita5189990ba7e0173b89fbdc115fb376d690d6f9c (patch)
tree0554f80e814e2f477c94ef1d54c5847e3d1b6a47 /audio
parentcb379b6a76ad441dc427e86bd17b47014a85fb7a (diff)
Fix DeviceCreated signal sending
Diffstat (limited to 'audio')
-rw-r--r--audio/manager.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/audio/manager.c b/audio/manager.c
index ae832f1c..7e29a9ea 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -141,6 +141,20 @@ static void remove_device(struct device *device)
static gboolean add_device(struct device *device)
{
+ dbus_connection_emit_signal(connection, AUDIO_MANAGER_PATH,
+ AUDIO_MANAGER_INTERFACE,
+ "DeviceCreated",
+ DBUS_TYPE_STRING, &device->path,
+ DBUS_TYPE_INVALID);
+
+ if (device->headset)
+ dbus_connection_emit_signal(connection,
+ AUDIO_MANAGER_PATH,
+ AUDIO_MANAGER_INTERFACE,
+ "HeadsetCreated",
+ DBUS_TYPE_STRING, &device->path,
+ DBUS_TYPE_INVALID);
+
if (default_dev == NULL && g_slist_length(devices) == 0) {
debug("Selecting default device");
default_dev = device;
@@ -310,26 +324,13 @@ static void finish_sdp(struct audio_sdp_data *data, gboolean success)
goto done;
}
- add_device(data->device);
-
update:
g_slist_foreach(data->records, (GFunc) handle_record, data->device);
+ if (!g_slist_find(devices, data->device))
+ add_device(data->device);
+
if (reply) {
- dbus_connection_emit_signal(connection, AUDIO_MANAGER_PATH,
- AUDIO_MANAGER_INTERFACE,
- "DeviceCreated",
- DBUS_TYPE_STRING,
- &data->device->path,
- DBUS_TYPE_INVALID);
- if (data->device->headset)
- dbus_connection_emit_signal(connection,
- AUDIO_MANAGER_PATH,
- AUDIO_MANAGER_INTERFACE,
- "HeadsetCreated",
- DBUS_TYPE_STRING,
- &data->device->path,
- DBUS_TYPE_INVALID);
dbus_message_append_args(reply, DBUS_TYPE_STRING,
&data->device->path,
DBUS_TYPE_INVALID);