From 2e6f80f808e7f8292cebc2631cb5262f775574e4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 18 Aug 2021 10:52:04 +0200 Subject: [PATCH] alsa: only list IEC958 codecs when iec958 or hdmi device. --- spa/plugins/alsa/alsa-pcm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/plugins/alsa/alsa-pcm.h b/spa/plugins/alsa/alsa-pcm.h index 081184809..3ce3b0008 100644 --- a/spa/plugins/alsa/alsa-pcm.h +++ b/spa/plugins/alsa/alsa-pcm.h @@ -295,6 +295,8 @@ static inline uint32_t spa_alsa_get_iec958_codecs(struct state *state, uint32_t { uint64_t mask = state->iec958_codecs; uint32_t i = 0, j = 0; + if (!(state->is_iec958 || state->is_hdmi)) + return 0; while (mask && i < max_codecs) { if (mask & 1) codecs[i++] = j;