improved mutex locking - less xruns when seeking

especially in JACK and macOS
This commit is contained in:
tildearrow 2022-03-23 21:38:28 -05:00
parent 11d9ce3f87
commit 711b60d454
5 changed files with 147 additions and 134 deletions

View file

@ -1408,7 +1408,13 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
memset(out[1],0,size*sizeof(float));
}
isBusy.lock();
if (softLocked) {
if (!isBusy.try_lock()) {
return;
}
} else {
isBusy.lock();
}
got.bufsize=size;
if (out!=NULL && ((sPreview.sample>=0 && sPreview.sample<(int)song.sample.size()) || (sPreview.wave>=0 && sPreview.wave<(int)song.wave.size()))) {