Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 082f5d2a authored by Rongxuan Liu's avatar Rongxuan Liu
Browse files

[le audio] Fix broadcast codec config if 48_2 is being used

If the source only support 48_2, we mistakenly falled back to 16_2
config. We should fix by checking if 48k config exist to use 48_2 config
instead.

Tag: #bug
Bug: 329134305
Flag: Exempt, small change to add additional config check, verified by QA locally
Test: manual testing with different quality settings
Test: atest bluetooth_le_audio_codec_manager_test

Change-Id: I40f2f7ee6c96a6a1babb7d87601db8cdc4e62b3a
parent 68f77ecb
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -279,9 +279,11 @@ struct codec_manager_impl {
        if (preferred_quality == bluetooth::le_audio::QUALITY_STANDARD) {
          broadcast_target_config = i;
        } else if (broadcast_target_config == -1 ||
                   (supported_broadcast_config[broadcast_target_config]
                            .sampling_rate != 24000u &&
                    supported_broadcast_config[broadcast_target_config]
                            .sampling_rate !=
                       24000u) {  // preferred_quality is QUALITY_HIGH, and
                        48000u)) {  // preferred_quality is QUALITY_HIGH, and
                                    // haven't get the 48_4 or 48_2 or 24_2
          broadcast_target_config = i;
        }