From 65d07dc838492caa1c5cbb8a0614f05524164401 Mon Sep 17 00:00:00 2001 From: OV2 Date: Tue, 28 Mar 2023 18:07:41 +0200 Subject: [PATCH] Wrap around when pushing single samples --- apu/resampler.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apu/resampler.h b/apu/resampler.h index a9173450..efc79c74 100644 --- a/apu/resampler.h +++ b/apu/resampler.h @@ -120,6 +120,8 @@ class Resampler if (end >= buffer_size) end -= buffer_size; buffer[end] = l; + if (end + 1 == buffer_size) + end -= buffer_size; buffer[end + 1] = r; size += 2; }