@@ -138,13 +138,13 @@ static bool valid_base_subgroup(const struct bt_bap_base_subgroup *subgroup)
138138 return false;
139139 }
140140
141- ret = bt_audio_codec_cfg_get_chan_allocation (& codec_cfg , & chan_allocation , false );
141+ ret = bt_audio_codec_cfg_get_chan_allocation (& codec_cfg , & chan_allocation , true );
142142 if (ret == 0 ) {
143143 chan_cnt = bt_audio_get_chan_count (chan_allocation );
144144 } else {
145- printk ("Could not get subgroup channel allocation: %d\n" , ret );
146- /* Channel allocation is an optional field, and omitting it implicitly means mono */
147- chan_cnt = 1U ;
145+ FAIL ("Could not get subgroup channel allocation: %d\n" , ret );
146+
147+ return false ;
148148 }
149149
150150 if (chan_cnt == 0 || (BIT (chan_cnt - 1 ) & SUPPORTED_CHAN_COUNTS ) == 0 ) {
@@ -169,13 +169,13 @@ static bool valid_base_subgroup(const struct bt_bap_base_subgroup *subgroup)
169169 return false;
170170 }
171171
172- ret = bt_audio_codec_cfg_get_frame_blocks_per_sdu (& codec_cfg , false );
172+ ret = bt_audio_codec_cfg_get_frame_blocks_per_sdu (& codec_cfg , true );
173173 if (ret > 0 ) {
174174 frames_blocks_per_sdu = (uint8_t )ret ;
175175 } else {
176- printk ("Could not get subgroup octets per frame : %d\n" , ret );
177- /* Frame blocks per SDU is optional and is implicitly 1 */
178- frames_blocks_per_sdu = 1U ;
176+ FAIL ("Could not get frame blocks per SDU : %d\n" , ret );
177+
178+ return false ;
179179 }
180180
181181 /* An SDU can consist of X frame blocks, each with Y frames (one per channel) of size Z in
@@ -460,7 +460,7 @@ static void validate_stream_codec_cfg(const struct bt_bap_stream *stream)
460460 /* The broadcast source sets the channel allocation in the BIS to
461461 * BT_AUDIO_LOCATION_FRONT_LEFT
462462 */
463- ret = bt_audio_codec_cfg_get_chan_allocation (codec_cfg , & chan_allocation , false );
463+ ret = bt_audio_codec_cfg_get_chan_allocation (codec_cfg , & chan_allocation , true );
464464 if (ret == 0 ) {
465465 if (chan_allocation != BT_AUDIO_LOCATION_FRONT_CENTER ) {
466466 FAIL ("Unexpected channel allocation: 0x%08X" , chan_allocation );
@@ -497,13 +497,12 @@ static void validate_stream_codec_cfg(const struct bt_bap_stream *stream)
497497 return ;
498498 }
499499
500- ret = bt_audio_codec_cfg_get_frame_blocks_per_sdu (codec_cfg , false );
500+ ret = bt_audio_codec_cfg_get_frame_blocks_per_sdu (codec_cfg , true );
501501 if (ret > 0 ) {
502502 frames_blocks_per_sdu = (uint8_t )ret ;
503503 } else {
504- printk ("Could not get octets per frame: %d\n" , ret );
505- /* Frame blocks per SDU is optional and is implicitly 1 */
506- frames_blocks_per_sdu = 1U ;
504+ FAIL ("Could not get frame blocks per SDU: %d\n" , ret );
505+ return ;
507506 }
508507
509508 /* An SDU can consist of X frame blocks, each with Y frames (one per channel) of size Z in
0 commit comments