bluetooth: Fix usage of RTP structures in SBC codec
authorPali Rohár <pali.rohar@gmail.com>
Sun, 21 Jul 2019 15:07:02 +0000 (17:07 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 24 Jul 2019 14:29:45 +0000 (17:29 +0300)
commit9e70d0520182700b66438bebacb4570b7c56aa59
tree7ce9909a446118184adcb28627c298fe815f5c2f
parent064277b4eee1af2c70a6abee1f8fa5d4d27120f8
bluetooth: Fix usage of RTP structures in SBC codec

Rename struct rtp_payload to rtp_sbc_payload as it is specific for SBC
codec payload.

Add proper checks for endianity in rtp.h header and use uint8_t type
where appropriated.

Field frame_count is only 4 bit number, so add checks to prevent overflow.

And because is_fragmented field is not parsed by decoder there is no
support for decoding fragmented SBC frames. So throw an error in this case.
src/modules/bluetooth/a2dp-codec-sbc.c
src/modules/bluetooth/rtp.h