Make foxenflac a little less memory hungry

We should really just use the xiph library :/
custom
jacqueline 1 year ago
parent 9b52fad86e
commit 9dc8f5646c
  1. 2
      lib/libfoxenflac/flac.c
  2. 8
      src/codecs/foxenflac.cpp

@ -305,7 +305,7 @@ static inline uint64_t fx_bitstream_peek_msb(fx_bitstream_t *reader,
* optimization. Furthermore, some platforms (WASM) do not allow unaligned * optimization. Furthermore, some platforms (WASM) do not allow unaligned
* memory access. * memory access.
*/ */
#define FX_ALIGN 16 #define FX_ALIGN 1
/** /**
* Macro telling the compiler that P is aligned with the specified alignment * Macro telling the compiler that P is aligned with the specified alignment

@ -19,7 +19,13 @@ namespace codecs {
[[maybe_unused]] static const char kTag[] = "flac"; [[maybe_unused]] static const char kTag[] = "flac";
FoxenFlacDecoder::FoxenFlacDecoder() FoxenFlacDecoder::FoxenFlacDecoder()
: input_(), buffer_(), flac_(FX_FLAC_ALLOC(FLAC_MAX_BLOCK_SIZE, 2)) {} : input_(),
buffer_(),
flac_(fx_flac_init(
heap_caps_malloc(fx_flac_size(FLAC_SUBSET_MAX_BLOCK_SIZE_48KHZ, 2),
MALLOC_CAP_SPIRAM),
FLAC_SUBSET_MAX_BLOCK_SIZE_48KHZ,
2)) {}
FoxenFlacDecoder::~FoxenFlacDecoder() { FoxenFlacDecoder::~FoxenFlacDecoder() {
free(flac_); free(flac_);

Loading…
Cancel
Save