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 {
139139 infoCallback (info, p_caller_ref);
140140 }
141141#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+ }
143147#endif
144148 }
145149 aacFrameInfo = info;
Original file line number Diff line number Diff line change @@ -147,11 +147,13 @@ class MP3DecoderHelix : public CommonHelix {
147147 infoCallback (info, p_caller_ref);
148148 }
149149#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+ }
155157#endif
156158 }
157159 mp3FrameInfo = info;
You can’t perform that action at this time.
0 commit comments