aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pcm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/pcm.c b/pcm.c
index a4f7f0e..ff1b5fc 100644
--- a/pcm.c
+++ b/pcm.c
@@ -121,7 +121,6 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
int retval;
- size_t bufsz;
/* Check supported channels */
if ((params_channels(hw_params) <
@@ -133,10 +132,8 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- bufsz = params_buffer_bytes(hw_params) *
- substream->runtime->hw.periods_max;
-
- retval = snd_pcm_lib_alloc_vmalloc_buffer(substream, bufsz);
+ retval = snd_pcm_lib_alloc_vmalloc_buffer(
+ substream, params_buffer_bytes(hw_params));
if (retval < 0)
D_ERRORK("pcm: buffer allocation failed: %d", retval);