summaryrefslogtreecommitdiff
path: root/android/a2dp.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2018-12-23 11:40:17 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2018-12-28 15:09:41 -0300
commitf29a5de80bd49e861992f97e4479440f01e4cc7a (patch)
tree45279fdebbaac04c0f084489890dea21026bd5ab /android/a2dp.c
parent86c7f72b0d150386f06ca07279dce40591d29921 (diff)
downloadbluez-f29a5de80bd49e861992f97e4479440f01e4cc7a.tar.gz
a2dp-codecs: Define a2dp_vendor_codec_t struct in endian neutral way
And define new macros A2DP_GET_VENDOR_ID(), A2DP_GET_CODEC_ID() and A2DP_SET_VENDOR_ID_CODEC_ID() for easily filling a2dp_vendor_codec_t struct.
Diffstat (limited to 'android/a2dp.c')
-rw-r--r--android/a2dp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/android/a2dp.c b/android/a2dp.c
index f21904208..8bcdfd20f 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -417,8 +417,8 @@ static int check_capabilities(struct a2dp_preset *preset,
preset->len);
case A2DP_CODEC_VENDOR:
vndcodec = (void *) codec->data;
- if (btohl(vndcodec->vendor_id) == APTX_VENDOR_ID &&
- btohs(vndcodec->codec_id) == APTX_CODEC_ID)
+ if (A2DP_GET_VENDOR_ID(*vndcodec) == APTX_VENDOR_ID &&
+ A2DP_GET_CODEC_ID(*vndcodec) == APTX_CODEC_ID)
return aptx_check_config(codec->data, codec_len,
preset->data, preset->len);
return -EINVAL;
@@ -1344,8 +1344,8 @@ static uint8_t register_endpoint(const uint8_t *uuid, uint8_t codec,
a2dp_vendor_codec_t *vndcodec = (void *) endpoint->caps->data;
avdtp_sep_set_vendor_codec(endpoint->sep,
- btohl(vndcodec->vendor_id),
- btohs(vndcodec->codec_id));
+ A2DP_GET_VENDOR_ID(*vndcodec),
+ A2DP_GET_CODEC_ID(*vndcodec));
}
endpoints = g_slist_append(endpoints, endpoint);