fix low quality not working in acquireDirect

performance may be reduced
This commit is contained in:
tildearrow 2025-04-07 23:12:27 -05:00
parent 584305f1fa
commit 032ff82955
4 changed files with 22 additions and 23 deletions

View file

@ -194,27 +194,14 @@ void DivDispatchContainer::fillBuf(size_t runtotal, size_t offset, size_t size)
}
}
}
if (lowQuality) {
for (int i=0; i<outs; i++) {
if (bbIn[i]==NULL) continue;
if (bb[i]==NULL) continue;
for (size_t j=0; j<runtotal; j++) {
if (bbIn[i][j]==temp[i]) continue;
temp[i]=bbIn[i][j];
blip_add_delta_fast(bb[i],j,temp[i]-prevSample[i]);
prevSample[i]=temp[i];
}
}
} else {
for (int i=0; i<outs; i++) {
if (bbIn[i]==NULL) continue;
if (bb[i]==NULL) continue;
for (size_t j=0; j<runtotal; j++) {
if (bbIn[i][j]==temp[i]) continue;
temp[i]=bbIn[i][j];
blip_add_delta(bb[i],j,temp[i]-prevSample[i]);
prevSample[i]=temp[i];
}
for (int i=0; i<outs; i++) {
if (bbIn[i]==NULL) continue;
if (bb[i]==NULL) continue;
for (size_t j=0; j<runtotal; j++) {
if (bbIn[i][j]==temp[i]) continue;
temp[i]=bbIn[i][j];
blip_add_delta(bb[i],j,temp[i]-prevSample[i]);
prevSample[i]=temp[i];
}
}
}

View file

@ -3763,6 +3763,12 @@ void DivEngine::initDispatch(bool isRender) {
lowQuality=getConfInt("audioQuality",0);
dcHiPass=getConfInt("audioHiPass",1);
if (lowQuality) {
blip_add_delta=blip_add_delta_fast;
} else {
blip_add_delta=blip_add_delta_slow;
}
for (int i=0; i<song.systemLen; i++) {
disCont[i].init(song.system[i],this,getChannelCount(song.system[i]),got.rate,song.systemFlags[i],isRender);
disCont[i].setRates(got.rate);