diff options
author | Jaroslav Kysela <perex@perex.cz> | 2010-01-08 02:43:01 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2010-01-08 02:46:45 -0500 |
commit | 7b3a177b0d4f92b3431b8dca777313a07533a710 (patch) | |
tree | 25a484491731ef31baa6a80f468ed78d6e553cd9 | |
parent | 1250932e48d3b698415b1f04775433cf1da688d6 (diff) |
ALSA: pcm_lib: fix "something must be really wrong" condition
When runtime->periods == 1 or when pointer crosses end of ring buffer,
the delta might be greater than buffer_size.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | sound/core/pcm_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index a63226232ef4..c7b35b20e659 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -362,7 +362,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, | |||
362 | (unsigned long)runtime->hw_ptr_base); | 362 | (unsigned long)runtime->hw_ptr_base); |
363 | } | 363 | } |
364 | /* something must be really wrong */ | 364 | /* something must be really wrong */ |
365 | if (delta >= runtime->buffer_size) { | 365 | if (delta >= runtime->buffer_size + runtime->period_size) { |
366 | hw_ptr_error(substream, | 366 | hw_ptr_error(substream, |
367 | "Unexpected hw_pointer value %s" | 367 | "Unexpected hw_pointer value %s" |
368 | "(stream=%i, pos=%ld, new_hw_ptr=%ld, " | 368 | "(stream=%i, pos=%ld, new_hw_ptr=%ld, " |