mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-26 12:27:51 +02:00
hopefully a fix for the linux crash
This commit is contained in:
@ -89,17 +89,17 @@ namespace dsp::loop {
|
||||
float maxAmp = 0;
|
||||
for (int j = i; j < count; j++) {
|
||||
if constexpr (std::is_same_v<T, complex_t>) {
|
||||
inAmp = in[i].amplitude();
|
||||
inAmp = in[j].amplitude();
|
||||
}
|
||||
if constexpr (std::is_same_v<T, float>) {
|
||||
inAmp = fabsf(in[i]);
|
||||
inAmp = fabsf(in[j]);
|
||||
}
|
||||
if (inAmp > maxAmp) { maxAmp = inAmp; }
|
||||
}
|
||||
amp = maxAmp;
|
||||
gain = _setPoint / maxAmp;
|
||||
gain = std::min<float>(_setPoint / amp, _maxGain);
|
||||
}
|
||||
|
||||
|
||||
// Scale output by gain
|
||||
out[i] = in[i] * gain;
|
||||
}
|
||||
|
@ -11,7 +11,12 @@ namespace dsp::sink {
|
||||
public:
|
||||
RingBuffer() {}
|
||||
|
||||
RingBuffer(stream<T>* in) { base_type::init(in); }
|
||||
RingBuffer(stream<T>* in, int maxLatency) { init(in, maxLatency); }
|
||||
|
||||
void init(stream<T>* in, int maxLatency) {
|
||||
data.init(maxLatency);
|
||||
base_type::init(in);
|
||||
}
|
||||
|
||||
int run() {
|
||||
int count = base_type::_in->read();
|
||||
|
Reference in New Issue
Block a user