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,13 +50,11 @@ 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) {
if (s->isLoopable() && chan.audPos>=s->getEndPosition()) {
chan.audPos=s->loopStart;
} else {
} else if (chan.audPos>=s->samples) {
chan.sample=-1;
}
}
if (chan.audPos<s->samples) {
output=s->data16[chan.audPos];
}