summaryrefslogtreecommitdiff
path: root/src/audio/audio_decoder.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-06-19 08:51:34 +1000
committerjacqueline <me@jacqueline.id.au>2023-06-19 08:51:34 +1000
commit6ff8b5886ef91ed46dba08686900d519f6c9c62d (patch)
tree133daa91898e047fd93a5e83ba6990af2904e5a1 /src/audio/audio_decoder.cpp
parent4e5dba158367f9b8b440e6c5051c95d9c22b76d7 (diff)
downloadtangara-fw-6ff8b5886ef91ed46dba08686900d519f6c9c62d.tar.gz
Support playing tracks by track id
Diffstat (limited to 'src/audio/audio_decoder.cpp')
-rw-r--r--src/audio/audio_decoder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp
index abb94e85..b4af65fb 100644
--- a/src/audio/audio_decoder.cpp
+++ b/src/audio/audio_decoder.cpp
@@ -89,9 +89,11 @@ auto AudioDecoder::Process(const std::vector<InputStream>& inputs,
// Check the input stream's format has changed (or, by extension, if this is
// the first stream).
if (!current_input_format_ || *current_input_format_ != info.format) {
- ESP_LOGI(kTag, "beginning new stream");
has_samples_to_send_ = false;
- ProcessStreamInfo(info);
+ if (!ProcessStreamInfo(info)) {
+ return;
+ }
+ ESP_LOGI(kTag, "beginning new stream");
auto res = current_codec_->BeginStream(input->data());
input->consume(res.first);
if (res.second.has_error()) {