On second thought, let’s not go to Camelot. ‘Tis a silly place.

This commit is contained in:
Charles J. Cliffe 2016-06-08 21:45:52 -04:00
parent 0067e309d1
commit d7ef86ae10

View File

@ -84,16 +84,11 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
}
srcmix->inputQueue->pop(srcmix->currentInput);
if (srcmix->isTerminated()) {
if (srcmix->currentInput) {
srcmix->currentInput->decRefCount();
}
continue;
}
continue;
}
// std::lock_guard < std::mutex > lock(srcmix->currentInput->m_mutex);
if (srcmix->currentInput->sampleRate != src->getSampleRate()) {
while (srcmix->inputQueue->size()) {
srcmix->inputQueue->pop(srcmix->currentInput);
@ -126,9 +121,6 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
}
srcmix->inputQueue->pop(srcmix->currentInput);
if (srcmix->isTerminated()) {
if (srcmix->currentInput) {
srcmix->currentInput->decRefCount();
}
continue;
}
}
@ -150,9 +142,6 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
}
srcmix->inputQueue->pop(srcmix->currentInput);
if (srcmix->isTerminated()) {
if (srcmix->currentInput) {
srcmix->currentInput->decRefCount();
}
break;
}
float srcPeak = srcmix->currentInput->peak * srcmix->gain;
@ -180,9 +169,6 @@ static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned
}
srcmix->inputQueue->pop(srcmix->currentInput);
if (srcmix->isTerminated()) {
if (srcmix->currentInput) {
srcmix->currentInput->decRefCount();
}
break;
}
float srcPeak = srcmix->currentInput->peak * srcmix->gain;
@ -414,6 +400,11 @@ void AudioThread::run() {
ref->decRefCount();
}
}
if (currentInput) {
currentInput->setRefCount(0);
currentInput = nullptr;
}
if (deviceController[parameters.deviceId] != this) {
deviceController[parameters.deviceId]->removeThread(this);