Commit 7b3a177b authored by Jaroslav Kysela's avatar Jaroslav Kysela

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: default avatarJaroslav Kysela <perex@perex.cz>
parent 1250932e
...@@ -362,7 +362,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, ...@@ -362,7 +362,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
(unsigned long)runtime->hw_ptr_base); (unsigned long)runtime->hw_ptr_base);
} }
/* something must be really wrong */ /* something must be really wrong */
if (delta >= runtime->buffer_size) { if (delta >= runtime->buffer_size + runtime->period_size) {
hw_ptr_error(substream, hw_ptr_error(substream,
"Unexpected hw_pointer value %s" "Unexpected hw_pointer value %s"
"(stream=%i, pos=%ld, new_hw_ptr=%ld, " "(stream=%i, pos=%ld, new_hw_ptr=%ld, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment