diff options
author | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-07-28 17:15:27 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@indt.org.br> | 2008-07-28 17:15:27 -0300 |
commit | 12d81a98fe65d109c0b1caa242e96b005bcc8209 (patch) | |
tree | 90886d363a308e8768b4d484e5a5516102524ca8 /audio/control.c | |
parent | d2fd09864d8b9e5289f0a6ab230063b32f661048 (diff) |
Cleanup audio manager.
Diffstat (limited to 'audio/control.c')
-rw-r--r-- | audio/control.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/audio/control.c b/audio/control.c index 9139213b..02fb8cd1 100644 --- a/audio/control.c +++ b/audio/control.c @@ -583,17 +583,15 @@ static int uinput_create(char *name) static void init_uinput(struct avctp *session) { - char address[18], *name; + char address[18]; ba2str(&session->dst, address); - name = session->dev->name ? session->dev->name : address; - - session->uinput = uinput_create(name); + session->uinput = uinput_create(address); if (session->uinput < 0) - error("AVRCP: failed to init uinput for %s", name); + error("AVRCP: failed to init uinput for %s", address); else - debug("AVRCP: uinput initialized for %s", name); + debug("AVRCP: uinput initialized for %s", address); } static void avctp_connect_session(struct avctp *session) @@ -601,8 +599,10 @@ static void avctp_connect_session(struct avctp *session) GIOChannel *io; session->state = AVCTP_STATE_CONNECTED; - session->dev = manager_device_connected(&session->dst, - AVRCP_TARGET_UUID); + session->dev = manager_find_device(&session->dst, NULL, FALSE); + if (!session->dev) + return; + session->dev->control->session = session; init_uinput(session); @@ -923,6 +923,9 @@ struct control *control_init(struct audio_device *dev) dev, NULL)) return NULL; + info("Registered interface %s on path %s", + AUDIO_CONTROL_INTERFACE, dev->path); + return g_new0(struct control, 1); } |