-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Bluetooth: audio: Handle lack of channel allocation structure #50249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,13 +123,16 @@ int bt_codec_cfg_get_chan_allocation_val(const struct bt_codec *codec, | |
|
|
||
| *chan_allocation = 0; | ||
| if (bt_codec_get_val(codec, BT_CODEC_CONFIG_LC3_CHAN_ALLOC, &element)) { | ||
|
|
||
| *chan_allocation = sys_le32_to_cpu(*((uint32_t *)&element->data.data[0])); | ||
|
|
||
| return BT_AUDIO_CODEC_PARSE_ERR_SUCCESS; | ||
| } | ||
|
|
||
| return BT_AUDIO_CODEC_PARSE_ERR_TYPE_NOT_FOUND; | ||
| /* BAP v1.0.1 4.3.2 Codec_Specific_Configuration LTV requirements | ||
| * The absence of the Audio_Channel_Allocation LTV structure | ||
| * shall be interpreted as a single channel with no specified Audio Location. | ||
| */ | ||
| return BT_AUDIO_LOCATION_UNSPECIFIED; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reasoning here to return Seems odd to return error code in all other instances, except this one (and even more weirdly to return 0, i.e. success, in that case). If we just want to return 0/sucess, instead of an error, I suggest that we just return 0 directly, instead of putting |
||
| } | ||
|
|
||
| int bt_codec_cfg_get_octets_per_frame(const struct bt_codec *codec) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put here sentence taken from the spec:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done