Home Home > GIT Browse > openSUSE-42.2
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-01-11 08:45:51 +0100
committerTakashi Iwai <tiwai@suse.de>2018-01-11 08:45:59 +0100
commit113de7714df60ce16ae43c59489fa01cc75fe0da (patch)
treedad22f3a2cb38e8c3d2082adaa3864c3dc140c96
parent32e6813d006f0d29841dec5d117f1b278a597dc6 (diff)
ALSA: aloop: Fix inconsistent format due to incomplete rule
(bsc#1031717). suse-commit: b7c68e607ccd79879e5e3d627072e07c3ffd68b6
-rw-r--r--sound/drivers/aloop.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index 2adc88d6d507..59e4a88757b1 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -39,6 +39,7 @@
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
+#include <sound/pcm_params.h>
#include <sound/info.h>
#include <sound/initval.h>
@@ -622,14 +623,12 @@ static int rule_format(struct snd_pcm_hw_params *params,
{
struct snd_pcm_hardware *hw = rule->private;
- struct snd_mask *maskp = hw_param_mask(params, rule->var);
+ struct snd_mask m;
- maskp->bits[0] &= (u_int32_t)hw->formats;
- maskp->bits[1] &= (u_int32_t)(hw->formats >> 32);
- memset(maskp->bits + 2, 0, (SNDRV_MASK_MAX-64) / 8); /* clear rest */
- if (! maskp->bits[0] && ! maskp->bits[1])
- return -EINVAL;
- return 0;
+ snd_mask_none(&m);
+ m.bits[0] = (u_int32_t)hw->formats;
+ m.bits[1] = (u_int32_t)(hw->formats >> 32);
+ return snd_mask_refine(hw_param_mask(params, rule->var), &m);
}
static int rule_rate(struct snd_pcm_hw_params *params,