summaryrefslogtreecommitdiff
path: root/android/avrcp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-06 14:55:57 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-03-06 17:14:48 +0200
commitfaeb9f0bb87b9db45cebb6728a81fcde7a8fd17b (patch)
treea89e948c40e56e20c2de45ab98aaeb802255d5cb /android/avrcp.c
parent0dad2408f870cc62d8c973ad6b623c6ffef4e892 (diff)
downloadbluez-faeb9f0bb87b9db45cebb6728a81fcde7a8fd17b.tar.gz
android/arvrcp: Fix not parsing SDP record correctly
Diffstat (limited to 'android/avrcp.c')
-rw-r--r--android/avrcp.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/android/avrcp.c b/android/avrcp.c
index d5eb31dae..911b1dfba 100644
--- a/android/avrcp.c
+++ b/android/avrcp.c
@@ -25,6 +25,7 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include <glib.h>
@@ -817,15 +818,22 @@ static void search_cb(sdp_list_t *recs, int err, gpointer data)
for (list = recs; list; list = list->next) {
sdp_record_t *rec = list->data;
- sdp_data_t *data;
+ sdp_list_t *l;
+ sdp_profile_desc_t *desc;
+ int features;
- data = sdp_data_get(rec, SDP_ATTR_VERSION);
- if (data)
- dev->version = data->val.uint16;
+ if (sdp_get_profile_descs(rec, &l) < 0)
+ continue;
- data = sdp_data_get(rec, SDP_ATTR_SUPPORTED_FEATURES);
- if (data)
- dev->features = data->val.uint16;
+ desc = l->data;
+ dev->version = desc->version;
+
+ if (sdp_get_int_attr(rec, SDP_ATTR_SUPPORTED_FEATURES,
+ &features) == 0)
+ dev->features = features;
+
+ sdp_list_free(l, free);
+ break;
}
if (dev->io) {