Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -286,6 +286,7 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf,
	mutex_lock(&stream->device->lock);
	/* write is allowed when stream is running or has been steup */
	if (stream->runtime->state != SNDRV_PCM_STATE_SETUP &&
	    stream->runtime->state != SNDRV_PCM_STATE_PREPARED &&
			stream->runtime->state != SNDRV_PCM_STATE_RUNNING) {
		mutex_unlock(&stream->device->lock);
		return -EBADFD;