MCPcopy Create free account
hub / github.com/FastLED/FastLED / init

Method init

src/fl/codec/mp3.cpp.hpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool Mp3HelixDecoder::init() {
28 if (mDecoder) {
29 return true; // Already initialized
30 }
31
32 // Initialize Helix decoder
33 mDecoder = MP3InitDecoder();
34 if (!mDecoder) {
35 return false;
36 }
37
38 // Allocate PCM buffer
39 mPcmBuffer.reset(new fl::i16[MAX_PCM_SAMPLES]); // ok bare allocation (array new)
40 if (!mPcmBuffer) {
41 MP3FreeDecoder(static_cast<HMP3Decoder>(mDecoder));
42 mDecoder = nullptr;
43 return false;
44 }
45
46 return true;
47}
48
49void Mp3HelixDecoder::reset() {
50 if (mDecoder) {

Callers 3

beginMethod · 0.45
resetMethod · 0.45
parseMp3InfoMethod · 0.45

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected