Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-01-10 20:41:49 +0100
committerTakashi Iwai <tiwai@suse.de>2019-01-11 08:35:12 +0100
commit7c7a1f949412e52ae5d2413a8ab209cb1bf33b31 (patch)
treea84a87c67f06d235cfd0d1dd3592b472ef9420a8
parentd59e0399c1fcd76ba46fc36423b0f84d8ab12554 (diff)
ALSA: pcm: Return 0 when size < start_threshold in capture
(bsc#1121278). suse-commit: 5776501b24c366e095c64c3d1d80312ba277e26b
-rw-r--r--sound/core/pcm_lib.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 4e6110d778bd..7f71c2449af5 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2173,11 +2173,16 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
goto _end_unlock;
if (!is_playback &&
- runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
- size >= runtime->start_threshold) {
- err = snd_pcm_start(substream);
- if (err < 0)
+ runtime->status->state == SNDRV_PCM_STATE_PREPARED) {
+ if (size >= runtime->start_threshold) {
+ err = snd_pcm_start(substream);
+ if (err < 0)
+ goto _end_unlock;
+ } else {
+ /* nothing to do */
+ err = 0;
goto _end_unlock;
+ }
}
runtime->twake = runtime->control->avail_min ? : 1;