From 0fd5483b5917955ce144528fc92f5f4e13f0e1b8 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 24 May 2023 02:38:43 -0500 Subject: [PATCH] SNES: fix BRR once again --- src/engine/sample.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/sample.cpp b/src/engine/sample.cpp index 2f8e7b99..ecd9752e 100644 --- a/src/engine/sample.cpp +++ b/src/engine/sample.cpp @@ -1130,8 +1130,9 @@ void DivSample::render(unsigned int formatMask) { } } if (NOT_IN_FORMAT(DIV_SAMPLE_DEPTH_BRR)) { // BRR - if (!initInternal(DIV_SAMPLE_DEPTH_BRR,samples)) return; - brrEncode(data16,dataBRR,samples,loop?loopStart:-1,brrEmphasis); + int sampleCount=loop?loopEnd:samples; + if (!initInternal(DIV_SAMPLE_DEPTH_BRR,sampleCount)) return; + brrEncode(data16,dataBRR,sampleCount,loop?loopStart:-1,brrEmphasis); } if (NOT_IN_FORMAT(DIV_SAMPLE_DEPTH_VOX)) { // VOX if (!initInternal(DIV_SAMPLE_DEPTH_VOX,samples)) return;