Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305805
b: refs/heads/master
c: 4f7c39d
h: refs/heads/master
i:
  305803: ded9cbb
v: v3
  • Loading branch information
Takashi Iwai committed May 21, 2012
1 parent 6e682c7 commit 7c26e81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 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: d4c6983859a82422640c727d2426b435dfff56f4
refs/heads/master: 4f7c39dc557cabdbc932ae83432cc225c480133c
12 changes: 11 additions & 1 deletion trunk/sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,14 @@ static int snd_pcm_prepare(struct snd_pcm_substream *substream,

static int snd_pcm_pre_drain_init(struct snd_pcm_substream *substream, int state)
{
substream->runtime->trigger_master = substream;
struct snd_pcm_runtime *runtime = substream->runtime;
switch (runtime->status->state) {
case SNDRV_PCM_STATE_OPEN:
case SNDRV_PCM_STATE_DISCONNECTED:
case SNDRV_PCM_STATE_SUSPENDED:
return -EBADFD;
}
runtime->trigger_master = substream;
return 0;
}

Expand All @@ -1379,6 +1386,9 @@ static int snd_pcm_do_drain_init(struct snd_pcm_substream *substream, int state)
case SNDRV_PCM_STATE_RUNNING:
runtime->status->state = SNDRV_PCM_STATE_DRAINING;
break;
case SNDRV_PCM_STATE_XRUN:
runtime->status->state = SNDRV_PCM_STATE_SETUP;
break;
default:
break;
}
Expand Down

0 comments on commit 7c26e81

Please sign in to comment.