From cee92e08a9232ac5661b76455e481d8423766f17 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Tue, 16 Jan 2024 23:45:52 +0200 Subject: [PATCH] bluez5: lc3: fix wrong enum_config The rate is not a bitmask. --- spa/plugins/bluez5/bap-codec-lc3.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spa/plugins/bluez5/bap-codec-lc3.c b/spa/plugins/bluez5/bap-codec-lc3.c index 0dd304609..6472018dd 100644 --- a/spa/plugins/bluez5/bap-codec-lc3.c +++ b/spa/plugins/bluez5/bap-codec-lc3.c @@ -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);