From f6b81d701ac90deebe75dde8d78553ea9e7a68f0 Mon Sep 17 00:00:00 2001 From: tobid7 Date: Sat, 29 Nov 2025 01:08:03 +0100 Subject: [PATCH] Fix critical errors were wrong vars were used --- include/ctrff/bcstm.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ctrff/bcstm.hpp b/include/ctrff/bcstm.hpp index ffac6a9..69945a9 100644 --- a/include/ctrff/bcstm.hpp +++ b/include/ctrff/bcstm.hpp @@ -29,13 +29,13 @@ class CTRFF_API BCSTM { } bool IsLooping() const { return pInfoBlock.StreamInfo.Loop; } PD::u32 GetLoopStart() const { - return pInfoBlock.StreamInfo.LoopStartFrame / GetNumBlocks(); + return pInfoBlock.StreamInfo.LoopStartFrame / GetBlockSamples(); } PD::u32 GetLoopEnd() const { /** Get temp references for better readability */ const PD::u32& loop_end = pInfoBlock.StreamInfo.LoopEndFrame; - const PD::u32& block_samples = GetNumBlocks(); - return (loop_end % block_samples ? block_samples + const PD::u32& block_samples = GetBlockSamples(); + return (loop_end % block_samples ? GetNumBlocks() : loop_end / block_samples); }