Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372060
b: refs/heads/master
c: 7548134
h: refs/heads/master
v: v3
  • Loading branch information
Vinod Koul authored and Takashi Iwai committed Apr 29, 2013
1 parent 6a759d2 commit fad38a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a555bb8c6bf6932c5706745bfdbad22df26324d9
refs/heads/master: 754813473c1a8b7711802313125f0fafc60141f8
12 changes: 10 additions & 2 deletions trunk/sound/core/compress_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,16 @@ static ssize_t snd_compr_read(struct file *f, char __user *buf,
stream = &data->stream;
mutex_lock(&stream->device->lock);

/* read is allowed when stream is running */
if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) {
/* read is allowed when stream is running, paused, draining and setup
* (yes setup is state which we transition to after stop, so if user
* wants to read data after stop we allow that)
*/
switch (stream->runtime->state) {
case SNDRV_PCM_STATE_OPEN:
case SNDRV_PCM_STATE_PREPARED:
case SNDRV_PCM_STATE_XRUN:
case SNDRV_PCM_STATE_SUSPENDED:
case SNDRV_PCM_STATE_DISCONNECTED:
retval = -EBADFD;
goto out;
}
Expand Down

0 comments on commit fad38a5

Please sign in to comment.