mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-30 14:17:51 +02:00
Fixed support in the module manager
This commit is contained in:
@ -77,6 +77,7 @@ namespace dsp {
|
||||
// NOTE: For some reason, the base class destrcutor doesn't get called.... this is a temporary fix I guess
|
||||
// I also don't check for _block_init for the exact sample reason, something's weird
|
||||
~Reshaper() {
|
||||
if (!generic_block<Reshaper<T>>::_block_init) { return; }
|
||||
generic_block<Reshaper<T>>::stop();
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ namespace dsp {
|
||||
void updateWindow(dsp::filter_window::generic_complex_window* window) {
|
||||
assert(generic_block<FMStereoDemuxPilotFilter>::_block_init);
|
||||
std::lock_guard<std::mutex> lck(generic_block<FMStereoDemuxPilotFilter>::ctrlMtx);
|
||||
std::lock_guard<std::mutex> lck2(bufMtx);
|
||||
_window = window;
|
||||
volk_free(taps);
|
||||
tapCount = window->getTapCount();
|
||||
@ -59,7 +60,7 @@ namespace dsp {
|
||||
int count = _in->read();
|
||||
if (count < 0) { return -1; }
|
||||
|
||||
generic_block<FMStereoDemuxPilotFilter>::ctrlMtx.lock();
|
||||
bufMtx.lock();
|
||||
|
||||
memcpy(bufStart, _in->readBuf, count * sizeof(complex_t));
|
||||
_in->flush();
|
||||
@ -70,12 +71,14 @@ namespace dsp {
|
||||
|
||||
memcpy(dataOut.writeBuf, &buffer[tapCount - ((tapCount-1)/2)], count * sizeof(complex_t));
|
||||
|
||||
if (!dataOut.swap(count)) { return -1; }
|
||||
if (!pilotOut.swap(count)) { return -1; }
|
||||
if (!pilotOut.swap(count) || !dataOut.swap(count)) {
|
||||
bufMtx.unlock();
|
||||
return -1;
|
||||
}
|
||||
|
||||
memmove(buffer, &buffer[count], tapCount * sizeof(complex_t));
|
||||
|
||||
generic_block<FMStereoDemuxPilotFilter>::ctrlMtx.unlock();
|
||||
bufMtx.unlock();
|
||||
|
||||
return count;
|
||||
}
|
||||
@ -89,6 +92,8 @@ namespace dsp {
|
||||
|
||||
dsp::filter_window::generic_complex_window* _window;
|
||||
|
||||
std::mutex bufMtx;
|
||||
|
||||
complex_t* bufStart;
|
||||
complex_t* buffer;
|
||||
int tapCount;
|
||||
|
Reference in New Issue
Block a user