summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2014-07-14 16:55:48 +0800
committerTakashi Iwai <tiwai@suse.de>2014-07-14 17:34:06 +0200
commit035f196bcdc1e9903ed52ad1859dc23d3aa74e72 (patch)
tree8304c8fd08554aa69f8c5786e98307a601a2db18
parentea865bba4615d906144ae5d4f72a4aad2baffe1f (diff)
pcm: rate: fix hw_ptr exceed the boundary
For long time test case, the hw_ptr will exceed the boundary, then cause the avail size wrong. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--src/pcm/pcm_rate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 7f667d4c..2563d824 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -574,6 +574,8 @@ static inline void snd_pcm_rate_sync_hwptr(snd_pcm_t *pcm)
rate->hw_ptr =
(slave_hw_ptr / rate->gen.slave->period_size) * pcm->period_size +
rate->ops.input_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
+
+ rate->hw_ptr %= pcm->boundary;
}
static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)