maybe macOS fixes and other

This commit is contained in:
AlexandreRouma 2022-06-20 19:55:13 +02:00
parent 53afaeda9e
commit 834890b69a
5 changed files with 20 additions and 2 deletions

View File

@ -10,6 +10,12 @@ namespace dsp::channel {
RxVFO(stream<complex_t>* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) { init(in, inSamplerate, outSamplerate, bandwidth, offset); } RxVFO(stream<complex_t>* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) { init(in, inSamplerate, outSamplerate, bandwidth, offset); }
~RxVFO() {
if (!base_type::_block_init) { return; }
base_type::stop();
taps::free(ftaps);
}
void init(stream<complex_t>* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) { void init(stream<complex_t>* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) {
_inSamplerate = inSamplerate; _inSamplerate = inSamplerate;
_outSamplerate = outSamplerate; _outSamplerate = outSamplerate;

View File

@ -14,7 +14,12 @@ namespace dsp::correction {
void init(stream<T>* in, double rate) { void init(stream<T>* in, double rate) {
_rate = rate; _rate = rate;
reset(); if constexpr (std::is_same_v<T, float>) {
offset = 0.0f;
}
if constexpr (std::is_same_v<T, complex_t> || std::is_same_v<T, stereo_t>) {
offset = { 0.0f, 0.0f };
}
base_type::init(in); base_type::init(in);
} }

View File

@ -18,6 +18,12 @@ namespace dsp::multirate {
RationalResampler(stream<T>* in, double inSamplerate, double outSamplerate) { init(in, inSamplerate, outSamplerate); } RationalResampler(stream<T>* in, double inSamplerate, double outSamplerate) { init(in, inSamplerate, outSamplerate); }
~RationalResampler() {
if (!base_type::_block_init) { return; }
base_type::stop();
taps::free(rtaps);
}
void init(stream<T>* in, double inSamplerate, double outSamplerate) { void init(stream<T>* in, double inSamplerate, double outSamplerate) {
_inSamplerate = inSamplerate; _inSamplerate = inSamplerate;
_outSamplerate = outSamplerate; _outSamplerate = outSamplerate;

View File

@ -12,6 +12,7 @@ namespace dsp::noise_reduction {
~Squelch() { ~Squelch() {
if (!base_type::_block_init) { return; } if (!base_type::_block_init) { return; }
base_type::stop();
buffer::free(normBuffer); buffer::free(normBuffer);
} }

View File

@ -17,7 +17,7 @@ namespace dsp::sink {
int count = base_type::_in->read(); int count = base_type::_in->read();
if (count < 0) { return -1; } if (count < 0) { return -1; }
if (data.write(_in->readBuf, count) < 0) { return -1; }
base_type::_in->flush(); base_type::_in->flush();
return count; return count;