summaryrefslogtreecommitdiff
path: root/src/codecs/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-11-07 15:57:56 +1100
committerjacqueline <me@jacqueline.id.au>2023-11-07 15:57:56 +1100
commit3abf599c4f8b04bed4ed67084588204f65a644d0 (patch)
treeeb826e85db5b9226c3edc4ac293bddc9f0279518 /src/codecs/include
parentb463ceaef4d82ee7c425c88749b9fd68ea27e5b8 (diff)
downloadtangara-fw-3abf599c4f8b04bed4ed67084588204f65a644d0.tar.gz
Improve memory usage of mad codec
- fix leaks - ensure the synth data is always in internal ram
Diffstat (limited to 'src/codecs/include')
-rw-r--r--src/codecs/include/mad.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codecs/include/mad.hpp b/src/codecs/include/mad.hpp
index 994e989c..813aa86d 100644
--- a/src/codecs/include/mad.hpp
+++ b/src/codecs/include/mad.hpp
@@ -45,9 +45,9 @@ class MadMp3Decoder : public ICodec {
std::shared_ptr<IStream> input_;
SourceBuffer buffer_;
- mad_stream* stream_;
- mad_frame* frame_;
- mad_synth* synth_;
+ std::unique_ptr<mad_stream> stream_;
+ std::unique_ptr<mad_frame> frame_;
+ std::unique_ptr<mad_synth> synth_;
int current_sample_;
bool is_eof_;