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

Method decodeNextFrame

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

Source from the content-addressed store, hash-verified

330}
331
332bool Mp3StreamDecoderImpl::decodeNextFrame(audio::Sample* out_sample) {
333 if (!isReady()) {
334 mErrorMsg = "Decoder not ready";
335 mHasError = true;
336 return false;
337 }
338
339 if (mEndOfStream) {
340 return false;
341 }
342
343 // Try to decode from existing buffer
344 if (findAndDecodeFrame(out_sample)) {
345 return true;
346 }
347
348 // Need more data - try to fill buffer and decode again
349 while (fillBuffer()) {
350 if (findAndDecodeFrame(out_sample)) {
351 return true;
352 }
353 }
354
355 // No more data available
356 mEndOfStream = true;
357 return false;
358}
359
360} // namespace third_party
361

Callers

nothing calls this directly

Calls 1

fillBufferFunction · 0.85

Tested by

no test coverage detected