diff --git a/src/engine/platform/pcmdac.cpp b/src/engine/platform/pcmdac.cpp index 314ba7dd1..213cb85a3 100644 --- a/src/engine/platform/pcmdac.cpp +++ b/src/engine/platform/pcmdac.cpp @@ -50,12 +50,10 @@ void DivPlatformPCMDAC::acquire(short* bufL, short* bufR, size_t start, size_t l } else { DivSample* s=parent->getSample(chan.sample); if (s->samples>0) { - if (chan.audPos>=s->samples) { - if (s->loopStart>=0 && s->loopStart<(int)s->samples) { - chan.audPos=s->loopStart; - } else { - chan.sample=-1; - } + if (s->isLoopable() && chan.audPos>=s->getEndPosition()) { + chan.audPos=s->loopStart; + } else if (chan.audPos>=s->samples) { + chan.sample=-1; } if (chan.audPossamples) { output=s->data16[chan.audPos];