File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,11 @@ class AACDecoderHelix : public CommonHelix {
139
139
infoCallback (info, p_caller_ref);
140
140
}
141
141
#if defined(ARDUINO) || defined(HELIX_PRINT)
142
- out->write ((uint8_t *)pcm_buffer.data (), info.outputSamps * sampleSize);
142
+ if (out != nullptr ){
143
+ size_t to_write = info.outputSamps * sampleSize;
144
+ size_t written = out->write ((uint8_t *)pcm_buffer.data (), to_write);
145
+ assert (written == to_write);
146
+ }
143
147
#endif
144
148
}
145
149
aacFrameInfo = info;
Original file line number Diff line number Diff line change @@ -147,11 +147,13 @@ class MP3DecoderHelix : public CommonHelix {
147
147
infoCallback (info, p_caller_ref);
148
148
}
149
149
#if defined(ARDUINO) || defined(HELIX_PRINT)
150
- int sampleSize = info.bitsPerSample / 8 ;
151
- int toWrite = info.outputSamps * sampleSize;
152
- int written = out->write ((uint8_t *)pcm_buffer.data (), toWrite);
153
- // assume blocking write
154
- assert (written == toWrite);
150
+ if (out != nullptr ){
151
+ int sampleSize = info.bitsPerSample / 8 ;
152
+ int toWrite = info.outputSamps * sampleSize;
153
+ int written = out->write ((uint8_t *)pcm_buffer.data (), toWrite);
154
+ // assume blocking write
155
+ assert (written == toWrite);
156
+ }
155
157
#endif
156
158
}
157
159
mp3FrameInfo = info;
You can’t perform that action at this time.
0 commit comments