From d1ca8d5d4bd338b8c48b1b7b517dc5fd723be68b Mon Sep 17 00:00:00 2001 From: minie4 Date: Wed, 28 Feb 2024 23:43:19 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20not=20using=20correct=20Po?= =?UTF-8?q?rt=20pointer=20in=20routing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `&out` is only a pointer to a copy of the Port object that the for loop creates - This results in `&out` always refering to the last processed list item instead of the specific port --- routing.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routing.go b/routing.go index d4d1122..6dafc01 100644 --- a/routing.go +++ b/routing.go @@ -144,8 +144,8 @@ func processJackCb(nframes uint32) int { // Get memory addresses to write to for all outputs var outputBuffers []JackOutputBuffers = []JackOutputBuffers{} - for _, out := range portConfig.Output { - outputBuffer := JackOutputBuffers{&out, [][]jack.AudioSample{}} + for i, out := range portConfig.Output { + outputBuffer := JackOutputBuffers{&portConfig.Output[i], [][]jack.AudioSample{}} for _, port := range out.object { buffer := port.GetBuffer(nframes) for i := range buffer {