X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=sound%2Fcore%2Fpcm_lib.c;h=30f410832a25991c44e2f71efcebb63abdb2b232;hb=4e7b8a6cef64a4c1f1194f9926f794c2b75ebdd7;hp=9db60d831bb25f67008824b18dab39bdf32b5073;hpb=e0b3032bcdf1419d97de636d5fb1c9469da75776;p=mv-sheeva.git diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 9db60d831bb..30f410832a2 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, avail = snd_pcm_capture_avail(runtime); if (avail > runtime->avail_max) runtime->avail_max = avail; - if (avail >= runtime->stop_threshold) { - if (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING) + if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { + if (avail >= runtime->buffer_size) { snd_pcm_drain_done(substream); - else + return -EPIPE; + } + } else { + if (avail >= runtime->stop_threshold) { xrun(substream); - return -EPIPE; + return -EPIPE; + } } if (avail >= runtime->control->avail_min) wake_up(&runtime->sleep);