ALSA: compress_core: don't return -EBADFD from poll if paused

Pausing audio playback is not an illegal state so it doesn't
seem sensible for poll() to return -EBADFD on a paused stream.
There's also no reason to assume that we can't write more data
to the DSP while playback is paused. Remove the -EBADFD so that
a stream in paused state will still report the buffer
availability from poll(). It is up to the user process to
manage its state so that it knows whether it is paused or not.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Acked-by VInod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Richard Fitzgerald 2013-10-22 11:26:48 +01:00 committed by Takashi Iwai
parent 679605c768
commit c15b149a30
1 changed files with 1 additions and 2 deletions

View File

@ -384,8 +384,7 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
return -EFAULT; return -EFAULT;
mutex_lock(&stream->device->lock); mutex_lock(&stream->device->lock);
if (stream->runtime->state == SNDRV_PCM_STATE_PAUSED || if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
retval = -EBADFD; retval = -EBADFD;
goto out; goto out;
} }