Commit 35383a24 authored by Eric Laurent's avatar Eric Laurent Committed by Takashi Iwai

ALSA: compress: allow writes in SNDRV_PCM_STATE_PREPARED state

Allow writes in SNDRV_PCM_STATE_PREPARED state so that more
than one buffer fragment can be written from user space
before calling SNDRV_COMPRESS_START.
Signed-off-by: default avatarEric Laurent <elaurent@google.com>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 59e42827
...@@ -286,6 +286,7 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf, ...@@ -286,6 +286,7 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf,
mutex_lock(&stream->device->lock); mutex_lock(&stream->device->lock);
/* write is allowed when stream is running or has been steup */ /* write is allowed when stream is running or has been steup */
if (stream->runtime->state != SNDRV_PCM_STATE_SETUP && if (stream->runtime->state != SNDRV_PCM_STATE_SETUP &&
stream->runtime->state != SNDRV_PCM_STATE_PREPARED &&
stream->runtime->state != SNDRV_PCM_STATE_RUNNING) { stream->runtime->state != SNDRV_PCM_STATE_RUNNING) {
mutex_unlock(&stream->device->lock); mutex_unlock(&stream->device->lock);
return -EBADFD; return -EBADFD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment