Skip to content

Commit 17c28c8

Browse files
committed
AAC & MP3 infoCallback on channel change
1 parent 837421d commit 17c28c8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/AACDecoderHelix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ class AACDecoderHelix : public CommonHelix {
135135
p_caller_data);
136136
} else {
137137
// output to stream
138-
if (info.sampRateOut != aacFrameInfo.sampRateOut &&
139-
infoCallback != nullptr) {
138+
if (infoCallback != nullptr
139+
&& (info.sampRateOut != aacFrameInfo.sampRateOut || info.nChans != aacFrameInfo.nChans)) {
140140
infoCallback(info, p_caller_ref);
141141
}
142142
#if defined(ARDUINO) || defined(HELIX_PRINT)

src/MP3DecoderHelix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class MP3DecoderHelix : public CommonHelix {
143143
p_caller_data);
144144
} else {
145145
// output to stream
146-
if ((info.samprate != mp3FrameInfo.samprate || info.nChans != mp3FrameInfo.nChans)
147-
&& infoCallback != nullptr) {
146+
if (infoCallback != nullptr
147+
&& (info.samprate != mp3FrameInfo.samprate || info.nChans != mp3FrameInfo.nChans)) {
148148
infoCallback(info, p_caller_ref);
149149
}
150150
#if defined(ARDUINO) || defined(HELIX_PRINT)

0 commit comments

Comments
 (0)