Skip to content

Commit 3247db4

Browse files
committed
Updated initialization method
1 parent 01aced3 commit 3247db4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

include/lsp-plug.in/dsp-units/meters/TruePeakMeter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace lsp
8383
/**
8484
* Initialize
8585
*/
86-
void init();
86+
bool init();
8787

8888
public:
8989
void update_settings();

src/main/meters/TruePeakMeter.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ namespace lsp
6868
pData = NULL;
6969
}
7070

71-
void TruePeakMeter::init()
71+
bool TruePeakMeter::init()
7272
{
7373
vBuffer = alloc_aligned<float>(pData, BUFFER_SIZE + MAX_BUFFER_TAIL, 0x40);
74+
if (vBuffer == NULL)
75+
return false;
76+
7477
clear();
78+
return true;
7579
}
7680

7781
uint8_t TruePeakMeter::calc_oversampling_multiplier(size_t sample_rate)

0 commit comments

Comments
 (0)