Skip to content

Commit 9577b6d

Browse files
committed
FLACEncoder constructor
1 parent cf82e18 commit 9577b6d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/AudioCodecs/CodecFLAC.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ namespace audio_tools {
3535
*/
3636
class FLACDecoder : public StreamingDecoder {
3737
public:
38-
FLACDecoder(bool isFLAC=false) {
39-
is_ogg = isFLAC;
38+
/// Default Constructor
39+
FLACDecoder(bool isOgg=false) {
40+
is_ogg = isOgg;
4041
}
4142

4243
/// Destructor - calls end();
@@ -254,8 +255,10 @@ class FLACDecoder : public StreamingDecoder {
254255
*/
255256
class FLACEncoder : public AudioEncoder {
256257
public:
257-
/// Empty Constructor - the output stream must be provided with begin()
258-
FLACEncoder() = default
258+
/// Default Constructor
259+
FLACEncoder(bool isOgg = false) {
260+
setOgg(isOgg);
261+
}
259262

260263
/// Destructor - calls end();
261264
~FLACEncoder() { end(); }
@@ -390,8 +393,8 @@ class FLACEncoder : public AudioEncoder {
390393
Vector<FLAC__int32> buffer;
391394
Print *p_print = nullptr;
392395
FLAC__StreamEncoder *p_encoder=nullptr;
393-
bool is_open;
394-
bool is_ogg;
396+
bool is_open = false;
397+
bool is_ogg = false;
395398
int flac_block_size = 512; // small value to minimize allocated memory
396399
int flac_compression_level = 8;
397400

0 commit comments

Comments
 (0)