diff options
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r-- | sound/core/pcm_lib.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 9db60d831bb2..30f410832a25 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -197,12 +197,16 @@ static int snd_pcm_update_hw_ptr_post(struct snd_pcm_substream *substream, | |||
197 | avail = snd_pcm_capture_avail(runtime); | 197 | avail = snd_pcm_capture_avail(runtime); |
198 | if (avail > runtime->avail_max) | 198 | if (avail > runtime->avail_max) |
199 | runtime->avail_max = avail; | 199 | runtime->avail_max = avail; |
200 | if (avail >= runtime->stop_threshold) { | 200 | if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { |
201 | if (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING) | 201 | if (avail >= runtime->buffer_size) { |
202 | snd_pcm_drain_done(substream); | 202 | snd_pcm_drain_done(substream); |
203 | else | 203 | return -EPIPE; |
204 | } | ||
205 | } else { | ||
206 | if (avail >= runtime->stop_threshold) { | ||
204 | xrun(substream); | 207 | xrun(substream); |
205 | return -EPIPE; | 208 | return -EPIPE; |
209 | } | ||
206 | } | 210 | } |
207 | if (avail >= runtime->control->avail_min) | 211 | if (avail >= runtime->control->avail_min) |
208 | wake_up(&runtime->sleep); | 212 | wake_up(&runtime->sleep); |