git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'topic/pcm-drain-nonblock' into for-linus
[pandora-kernel.git]
/
sound
/
core
/
pcm_lib.c
diff --git
a/sound/core/pcm_lib.c
b/sound/core/pcm_lib.c
index
9db60d8
..
30f4108
100644
(file)
--- 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;
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);
snd_pcm_drain_done(substream);
- else
+ return -EPIPE;
+ }
+ } else {
+ if (avail >= runtime->stop_threshold) {
xrun(substream);
xrun(substream);
- return -EPIPE;
+ return -EPIPE;
+ }
}
if (avail >= runtime->control->avail_min)
wake_up(&runtime->sleep);
}
if (avail >= runtime->control->avail_min)
wake_up(&runtime->sleep);