From 9dc8f5646c0d4741636396b0c08309263af5e323 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 7 Nov 2023 13:37:58 +1100 Subject: Make foxenflac a little less memory hungry We should really just use the xiph library :/ --- src/codecs/foxenflac.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/codecs/foxenflac.cpp') diff --git a/src/codecs/foxenflac.cpp b/src/codecs/foxenflac.cpp index 7d11d4f1..1fd95cd1 100644 --- a/src/codecs/foxenflac.cpp +++ b/src/codecs/foxenflac.cpp @@ -19,7 +19,13 @@ namespace codecs { [[maybe_unused]] static const char kTag[] = "flac"; 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() { free(flac_); -- cgit v1.2.3