diff options
| -rw-r--r-- | ports/nrf/common-hal/audiobusio/I2SOut.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 6c64fb8cd..25ae48f59 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -140,6 +140,10 @@ stopping: ; goto stopping; } } + if (get_buffer_result == GET_BUFFER_ERROR || sample_buffer_length == 0) { + self->stopping = true; + goto stopping; + } } uint16_t bytecount = MIN(bytesleft, (size_t)(self->sample_end - self->sample_data)); if (self->samples_signed) { |
