Fix: Bluez crash while making a2dp connection
authorhimanshu <h.himanshu@samsung.com>
Wed, 29 Jan 2020 07:07:39 +0000 (12:37 +0530)
committerhimanshu <h.himanshu@samsung.com>
Tue, 11 Feb 2020 08:58:20 +0000 (14:28 +0530)
As the a2dp_sep struct in the a2dp_find_eps
function has been changed to queue in the
BlueZ 5.52 Release,therefore the necessary
change was needed in the TIZEN_MODIFY code.

Change-Id: I9bdb50b341356abd845ff8e3ab9a446991b25091
Signed-off-by: himanshu <h.himanshu@samsung.com>
profiles/audio/a2dp.c

index f404a56..edceef0 100644 (file)
@@ -2665,7 +2665,7 @@ static struct queue *a2dp_find_eps(struct avdtp *session, GSList *list,
                                        const char *sender)
 {
 #ifdef TIZEN_FEATURE_BLUEZ_MODIFY
-       struct a2dp_sep *selected_sep = NULL;
+       struct queue *selected_sep = NULL;
 #endif
 
        struct a2dp_channel *chan = find_channel(session);
@@ -2700,12 +2700,12 @@ static struct queue *a2dp_find_eps(struct avdtp *session, GSList *list,
                cap = (struct avdtp_media_codec_capability *) service->data;
 
                if (cap->media_codec_type != A2DP_CODEC_VENDOR) {
-                       selected_sep = sep;
+                       queue_push_head(selected_sep,sep);
                        continue;
 #ifdef TIZEN_FEATURE_SSC_ENCODER
                } else {
                        /* This is vendor codec */
-                       selected_sep = sep;
+                       queue_push_head(selected_sep, sep);
                        if (endpoint_match_codec_preference(session, cap, sep))
                                return selected_sep;
                        continue;