From b859f27109a9b92712bf2389cfdad8002f0b6201 Mon Sep 17 00:00:00 2001 From: Andy Sloane Date: Tue, 3 Nov 2015 18:16:00 -0800 Subject: [PATCH] disable looping if looplen = 0... so much pathological crap in XM files... --- xm.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xm.js b/xm.js index 05ddf84..a135eea 100644 --- a/xm.js +++ b/xm.js @@ -472,7 +472,7 @@ function MixChannelIntoBuf(ch, start, end, dataL, dataR) { var samp = instsamp.sampledata; var sample_end = instsamp.len; - if ((instsamp.type & 3) == 1) { // todo: support pingpong + if ((instsamp.type & 3) == 1 && instsamp.looplen > 0) { loop = true; loopstart = instsamp.loop; looplen = instsamp.looplen; @@ -511,7 +511,8 @@ function MixChannelIntoBuf(ch, start, end, dataL, dataR) { var failsafe = 100; while (i < end) { if (failsafe-- == 0) { - console.log("failsafe in mixing loop!", k, sample_end, loopstart, looplen, dk); + console.log("failsafe in mixing loop! channel", ch.number, k, sample_end, + loopstart, looplen, dk); break; } if (k >= sample_end) { // TODO: implement pingpong looping