diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index 727664112..f687140d7 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -82,7 +82,7 @@ s_xfer_paint_buffer (portable_samplepair_t *paintbuffer, int count, p = (float *) paintbuffer; count *= snd_shm->channels; out_max = (snd_shm->frames * snd_shm->channels) - 1; - out_idx = snd_shm->framepos * snd_shm->channels; + out_idx = snd_paintedtime * snd_shm->channels; while (out_idx > out_max) out_idx -= out_max + 1; step = 3 - snd_shm->channels; diff --git a/libs/audio/targets/snd_alsa.c b/libs/audio/targets/snd_alsa.c index 19af26ad3..55f0369ea 100644 --- a/libs/audio/targets/snd_alsa.c +++ b/libs/audio/targets/snd_alsa.c @@ -150,7 +150,7 @@ SNDDMA_ni_xfer (portable_samplepair_t *paintbuffer, int count, float volume) p = (float *) paintbuffer; out_max = sn.frames - 1; - out_idx = sn.framepos; + out_idx = *plugin_info_snd_output_data.paintedtime; while (out_idx > out_max) out_idx -= out_max + 1;