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

Method begin

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

Source from the content-addressed store, hash-verified

167}
168
169bool Mp3StreamDecoderImpl::begin(fl::filebuf_ptr stream) {
170 if (!stream) {
171 mErrorMsg = "Invalid stream provided";
172 mHasError = true;
173 return false;
174 }
175
176 mStream = stream;
177 mDecoder = fl::make_unique<Mp3HelixDecoder>();
178 if (!mDecoder->init()) {
179 mErrorMsg = "Failed to initialize MP3 decoder";
180 mHasError = true;
181 mDecoder.reset();
182 return false;
183 }
184
185 mBuffer.resize(BUFFER_SIZE);
186 mBufferPos = 0;
187 mBufferFilled = 0;
188 mBytesProcessed = 0;
189 mHasError = false;
190 mEndOfStream = false;
191 mHasDecodedFirstFrame = false;
192
193 return true;
194}
195
196void Mp3StreamDecoderImpl::end() {
197 mDecoder.reset();

Callers 4

parseGifInfoMethod · 0.45
openMpeg1VideoMethod · 0.45
openMp3Method · 0.45
parseMpeg1InfoMethod · 0.45

Calls 3

initMethod · 0.45
resetMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected