bluez5: lc3: fix wrong enum_config

The rate is not a bitmask.
This commit is contained in:
Pauli Virtanen 2024-01-16 23:45:52 +02:00
parent 94cde3090e
commit cee92e08a9

View file

@ -669,27 +669,27 @@ static int codec_enum_config(const struct media_codec *codec, uint32_t flags,
spa_pod_builder_push_choice(b, &f[1], SPA_CHOICE_None, 0);
choice = (struct spa_pod_choice*)spa_pod_builder_frame(b, &f[1]);
i = 0;
if (conf.rate & LC3_CONFIG_FREQ_48KHZ) {
if (conf.rate == LC3_CONFIG_FREQ_48KHZ) {
if (i++ == 0)
spa_pod_builder_int(b, 48000);
spa_pod_builder_int(b, 48000);
}
if (conf.rate & LC3_CONFIG_FREQ_32KHZ) {
if (conf.rate == LC3_CONFIG_FREQ_32KHZ) {
if (i++ == 0)
spa_pod_builder_int(b, 32000);
spa_pod_builder_int(b, 32000);
}
if (conf.rate & LC3_CONFIG_FREQ_24KHZ) {
if (conf.rate == LC3_CONFIG_FREQ_24KHZ) {
if (i++ == 0)
spa_pod_builder_int(b, 24000);
spa_pod_builder_int(b, 24000);
}
if (conf.rate & LC3_CONFIG_FREQ_16KHZ) {
if (conf.rate == LC3_CONFIG_FREQ_16KHZ) {
if (i++ == 0)
spa_pod_builder_int(b, 16000);
spa_pod_builder_int(b, 16000);
}
if (conf.rate & LC3_CONFIG_FREQ_8KHZ) {
if (conf.rate == LC3_CONFIG_FREQ_8KHZ) {
if (i++ == 0)
spa_pod_builder_int(b, 8000);
spa_pod_builder_int(b, 8000);