tlv: ignore xdir when type is DB_MINMAX_MUTE

Muting caused by rounding is meaningless, and it is also inconvenient
for upper-layer applications to handling muting issues caused by
DB_MINMAX_MUTE or xdir. Thus, the restriction on xdir is removed.
This commit is contained in:
qaqland 2025-09-02 09:00:40 +08:00
parent 3a97718124
commit b18e40e63a

View file

@ -369,7 +369,7 @@ int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax,
min = tlv[SNDRV_CTL_TLVO_DB_MINMAX_MIN];
max = tlv[SNDRV_CTL_TLVO_DB_MINMAX_MAX];
if (db_gain <= min)
if (db_gain > SND_CTL_TLV_DB_GAIN_MUTE && xdir > 0 &&
if (db_gain > SND_CTL_TLV_DB_GAIN_MUTE &&
type == SND_CTL_TLVT_DB_MINMAX_MUTE)
*value = rangemin + 1;
else