The function snd_pcm_ioplug_hw_ptr_update() always increased the hw_ptr
by delta, without wrapping it to the boundary. This would lead to
problems when after many hours, the hw_ptr would overflow.
Signed-off-by: Luciano Montanaro <luciano.montanaro@magnetimarelli.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
delta = hw - io->last_hw;
else
delta = pcm->buffer_size + hw - io->last_hw;
- io->data->hw_ptr += delta;
+ snd_pcm_mmap_hw_forward(io->data->pcm, delta);
io->last_hw = hw;
} else
io->data->state = SNDRV_PCM_STATE_XRUN;