mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-05-16 18:25:31 +01:00
applied platformio structure
This commit is contained in:
28
lib/spotify/cspot/bell/main/audio-codec/BaseCodec.cpp
Normal file
28
lib/spotify/cspot/bell/main/audio-codec/BaseCodec.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "BaseCodec.h"
|
||||
|
||||
#include "AudioContainer.h" // for AudioContainer
|
||||
|
||||
using namespace bell;
|
||||
|
||||
bool BaseCodec::setup(AudioContainer* container) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t* BaseCodec::decode(AudioContainer* container, uint32_t& outLen) {
|
||||
auto* data = container->readSample(lastSampleLen);
|
||||
if (data == nullptr) {
|
||||
outLen = 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (lastSampleLen == 0) {
|
||||
outLen = 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
availableBytes = lastSampleLen;
|
||||
auto* result = decode((uint8_t*)data, availableBytes, outLen);
|
||||
container->consumeBytes(lastSampleLen - availableBytes);
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user