mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Merge branch 'topic/pcm-drain-nonblock' into for-linus
* topic/pcm-drain-nonblock: ALSA: pcm - Increase protocol version ALSA: pcm - Fix drain behavior in non-blocking mode
This commit is contained in:
commit
2c0d19a78d
3 changed files with 38 additions and 28 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue