From 211773c714ff39a2f579ca656a6c6e916434b1bb Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 17 Jul 2018 18:09:59 -0700 Subject: [PATCH] Fix decoder so it ends properly on non-looped files when Repeat One is enabled. --- Plugins/vgmstream/vgmstream/VGMDecoder.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plugins/vgmstream/vgmstream/VGMDecoder.m b/Plugins/vgmstream/vgmstream/VGMDecoder.m index 8bbb6a668..d83f60b1b 100644 --- a/Plugins/vgmstream/vgmstream/VGMDecoder.m +++ b/Plugins/vgmstream/vgmstream/VGMDecoder.m @@ -61,7 +61,9 @@ { BOOL repeatone = IsRepeatOneSet(); - if (!repeatone) { + BOOL loopokay = repeatone && stream->loop_flag; + + if (!loopokay) { if (framesRead >= totalFrames) return 0; else if (framesRead + frames > totalFrames) frames = (UInt32)(totalFrames - framesRead);