Diff between 3c5413c3dd519ebbe385f480db0e3780d16d6b54 and 73f55340288d8c7368376c2c95ef9726fd525c4e

Changed Files

File Additions Deletions Status
profiles/audio/a2dp-codecs.h +2 -2 modified
profiles/audio/a2dp.c +4 -8 modified
tools/avinfo.c +3 -5 modified

Full Patch

diff --git a/profiles/audio/a2dp-codecs.h b/profiles/audio/a2dp-codecs.h
index 3dc31cb..0f44b10 100644
--- a/profiles/audio/a2dp-codecs.h
+++ b/profiles/audio/a2dp-codecs.h
@@ -134,6 +134,6 @@ typedef struct {
 #endif
 
 typedef struct {
-	uint8_t vendor_id[4];
-	uint8_t codec_id[2];
+	uint32_t vendor_id;
+	uint16_t codec_id;
 } __attribute__ ((packed)) a2dp_vendor_codec_t;
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index cabdd66..c9dac9a 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -1390,18 +1390,14 @@ static gboolean check_vendor_codec(struct a2dp_sep *sep, uint8_t *cap,
 
 	local_codec = (a2dp_vendor_codec_t *) capabilities;
 
-	if (memcmp(remote_codec->vendor_id, local_codec->vendor_id,
-					sizeof(local_codec->vendor_id)))
+	if (btohl(remote_codec->vendor_id) != btohl(local_codec->vendor_id))
 		return FALSE;
 
-	if (memcmp(remote_codec->codec_id, local_codec->codec_id,
-					sizeof(local_codec->codec_id)))
+	if (btohs(remote_codec->codec_id) != btohs(local_codec->codec_id))
 		return FALSE;
 
-	DBG("vendor 0x%02x%02x%02x%02x codec 0x%02x%02x",
-			remote_codec->vendor_id[0], remote_codec->vendor_id[1],
-			remote_codec->vendor_id[2], remote_codec->vendor_id[3],
-			remote_codec->codec_id[0], remote_codec->codec_id[1]);
+	DBG("vendor 0x%08x codec 0x%04x", btohl(remote_codec->vendor_id),
+						btohs(remote_codec->codec_id));
 
 	return TRUE;
 }
diff --git a/tools/avinfo.c b/tools/avinfo.c
index a4deaac..e7747db 100644
--- a/tools/avinfo.c
+++ b/tools/avinfo.c
@@ -162,12 +162,10 @@ static void print_vendor(a2dp_vendor_codec_t *vendor)
 {
 	printf("\tMedia Codec: Vendor Specific A2DP Codec");
 
-	printf("\n\t\tVendor ID 0x%02x%02x%02x%02x", vendor->vendor_id[0],
-		vendor->vendor_id[1], vendor->vendor_id[2],
-		vendor->vendor_id[3]);
+	printf("\n\t\tVendor ID 0x%08x", btohl(vendor->vendor_id));
 
-	printf("\n\t\tVendor Specific Codec ID 0x%02x%02x\n",
-			vendor->codec_id[0], vendor->codec_id[1]);
+	printf("\n\t\tVendor Specific Codec ID 0x%04x\n",
+						btohs(vendor->codec_id));
 }
 
 static void print_mpeg24(a2dp_mpeg_t *mpeg)