summaryrefslogtreecommitdiff
path: root/profiles/audio/control.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-06-28 11:01:00 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-07-12 15:05:45 +0300
commitee5df16263d40ff0dcec913baa4943b56f5bcad0 (patch)
tree3b7ee9816207864ff46b72c36f136f253f81a60c /profiles/audio/control.c
parentcf43fae8a46621e2ba758c755366a4aea1c5ef4d (diff)
downloadbluez-ee5df16263d40ff0dcec913baa4943b56f5bcad0.tar.gz
audio/AVCTP: Remove dependency on struct audio_device
This is part of the work necessary to completely remove struct audio_device
Diffstat (limited to 'profiles/audio/control.c')
-rw-r--r--profiles/audio/control.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/profiles/audio/control.c b/profiles/audio/control.c
index 7cfbcc699..9b614c326 100644
--- a/profiles/audio/control.c
+++ b/profiles/audio/control.c
@@ -69,12 +69,12 @@ struct control {
unsigned int avctp_id;
};
-static void state_changed(struct audio_device *dev, avctp_state_t old_state,
- avctp_state_t new_state)
+static void state_changed(struct btd_device *dev, avctp_state_t old_state,
+ avctp_state_t new_state, void *user_data)
{
+ struct control *control = user_data;
DBusConnection *conn = btd_get_dbus_connection();
- struct control *control = btd_service_get_user_data(dev->control);
- const char *path = device_get_path(dev->btd_dev);
+ const char *path = device_get_path(dev);
switch (new_state) {
case AVCTP_STATE_DISCONNECTED:
@@ -110,7 +110,7 @@ int control_connect(struct btd_service *service)
if (!control->target)
return -ENOTSUP;
- control->session = avctp_connect(control->dev);
+ control->session = avctp_connect(control->dev->btd_dev);
if (!control->session)
return -EIO;
@@ -287,7 +287,8 @@ static struct control *control_init(struct audio_device *dev)
control = g_new0(struct control, 1);
control->dev = dev;
- control->avctp_id = avctp_add_state_cb(dev, state_changed);
+ control->avctp_id = avctp_add_state_cb(dev->btd_dev, state_changed,
+ control);
return control;
}