summaryrefslogtreecommitdiff
path: root/src/audio
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-01-26 15:09:59 +1100
committerjacqueline <me@jacqueline.id.au>2023-01-26 15:09:59 +1100
commit3696512b387ceefd25c00830fb24ddd073c06e2c (patch)
tree796de7fe246050ec874987dd4fa49932d4c6c986 /src/audio
parentf6dcd845fc80da4e3043146e4362258dd8e0c0a1 (diff)
downloadtangara-fw-3696512b387ceefd25c00830fb24ddd073c06e2c.tar.gz
Fix memory leak, re-enable play command (it doesnt work lol)
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/audio_decoder.cpp6
-rw-r--r--src/audio/audio_playback.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp
index 8ef90905..87959cd4 100644
--- a/src/audio/audio_decoder.cpp
+++ b/src/audio/audio_decoder.cpp
@@ -21,7 +21,11 @@ namespace audio {
static const std::size_t kSamplesPerChunk = 256;
-AudioDecoder::AudioDecoder() : IAudioElement(), stream_info_({}) {}
+AudioDecoder::AudioDecoder()
+ : IAudioElement(),
+ stream_info_({}),
+ has_samples_to_send_(false),
+ needs_more_input_(true) {}
AudioDecoder::~AudioDecoder() {}
diff --git a/src/audio/audio_playback.cpp b/src/audio/audio_playback.cpp
index fae096d0..6098296d 100644
--- a/src/audio/audio_playback.cpp
+++ b/src/audio/audio_playback.cpp
@@ -38,11 +38,11 @@ auto AudioPlayback::create(drivers::GpioExpander* expander,
playback->ConnectElements(codec.get(), sink.get());
// Launch!
- /*
playback->element_handles_.push_back(StartAudioTask("src", source));
playback->element_handles_.push_back(StartAudioTask("dec", codec));
playback->element_handles_.push_back(StartAudioTask("sink", sink));
- */
+
+ playback->input_handle_ = source->InputEventQueue();
return playback;
}