parent
73204b5378
commit
a10d5cb96b
2 changed files with 32 additions and 5 deletions
|
|
@ -147,7 +147,24 @@ void DivDispatchContainer::grow(size_t size) {
|
|||
void DivDispatchContainer::acquire(size_t offset, size_t count) {
|
||||
CHECK_MISSING_BUFS;
|
||||
|
||||
|
||||
if (rateMul) {
|
||||
//logV("req: from %d to %d",offset,offset+count-1);
|
||||
offset+=runPosSub;
|
||||
size_t oldCount=count;
|
||||
runPosSub=(runPosSub+oldCount)&((1<<rateMul)-1);
|
||||
count+=runPosSub;
|
||||
|
||||
offset>>=rateMul;
|
||||
count>>=rateMul;
|
||||
|
||||
if (offset!=0 && offset!=lastCount) {
|
||||
logW("Shit!");
|
||||
}
|
||||
|
||||
lastCount=offset+count;
|
||||
|
||||
logV("got: from %d to %d",offset,offset+count-1);
|
||||
}
|
||||
|
||||
for (int i=0; i<DIV_MAX_OUTPUTS; i++) {
|
||||
if (i>=outs) {
|
||||
|
|
@ -189,7 +206,7 @@ void DivDispatchContainer::fillBuf(size_t runtotal, size_t offset, size_t size)
|
|||
if (bbIn[i]==NULL) continue;
|
||||
if (bb[i]==NULL) continue;
|
||||
int s=0;
|
||||
for (size_t j=0; j<runtotal; j+=step) {
|
||||
for (size_t j=fillSub; j<runtotal; j+=step) {
|
||||
temp[i]=bbIn[i][s++];
|
||||
blip_add_delta_fast(bb[i],j,temp[i]-prevSample[i]);
|
||||
prevSample[i]=temp[i];
|
||||
|
|
@ -200,7 +217,7 @@ void DivDispatchContainer::fillBuf(size_t runtotal, size_t offset, size_t size)
|
|||
if (bbIn[i]==NULL) continue;
|
||||
if (bb[i]==NULL) continue;
|
||||
int s=0;
|
||||
for (size_t j=0; j<runtotal; j+=step) {
|
||||
for (size_t j=fillSub; j<runtotal; j+=step) {
|
||||
temp[i]=bbIn[i][s++];
|
||||
blip_add_delta(bb[i],j,temp[i]-prevSample[i]);
|
||||
prevSample[i]=temp[i];
|
||||
|
|
@ -208,6 +225,10 @@ void DivDispatchContainer::fillBuf(size_t runtotal, size_t offset, size_t size)
|
|||
}
|
||||
}
|
||||
|
||||
if (rateMul) {
|
||||
fillSub=(fillSub+runtotal)&((1<<rateMul)-1);
|
||||
}
|
||||
|
||||
for (int i=0; i<outs; i++) {
|
||||
if (bbOut[i]==NULL) continue;
|
||||
if (bb[i]==NULL) continue;
|
||||
|
|
@ -228,6 +249,10 @@ void DivDispatchContainer::clear() {
|
|||
prevSample[i]=0;
|
||||
}
|
||||
|
||||
runPosSub=0;
|
||||
fillSub=0;
|
||||
lastCount=0;
|
||||
|
||||
if (dispatch->getDCOffRequired()) {
|
||||
dcOffCompensation=true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue