Apply loop end position for generic DAC

This commit is contained in:
cam900 2022-07-24 12:23:38 +09:00
parent e08399156a
commit b48b7c8bc5
1 changed files with 4 additions and 6 deletions

View File

@ -50,12 +50,10 @@ void DivPlatformPCMDAC::acquire(short* bufL, short* bufR, size_t start, size_t l
} else { } else {
DivSample* s=parent->getSample(chan.sample); DivSample* s=parent->getSample(chan.sample);
if (s->samples>0) { if (s->samples>0) {
if (chan.audPos>=s->samples) { if (s->isLoopable() && chan.audPos>=s->getEndPosition()) {
if (s->loopStart>=0 && s->loopStart<(int)s->samples) { chan.audPos=s->loopStart;
chan.audPos=s->loopStart; } else if (chan.audPos>=s->samples) {
} else { chan.sample=-1;
chan.sample=-1;
}
} }
if (chan.audPos<s->samples) { if (chan.audPos<s->samples) {
output=s->data16[chan.audPos]; output=s->data16[chan.audPos];