We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 234ebf4 commit 216374cCopy full SHA for 216374c
1 file changed
ports/espressif/common-hal/audiobusio/__init__.c
@@ -42,14 +42,15 @@ static void i2s_fill_buffer(i2s_t *self) {
42
while (!self->stopping && output_buffer_size > 0) {
43
if (self->sample_data == self->sample_end) {
44
uint32_t sample_buffer_length;
45
+ uint8_t *old_sample_data = self->sample_data;
46
audioio_get_buffer_result_t get_buffer_result =
47
audiosample_get_buffer(self->sample, false, 0,
48
&self->sample_data, &sample_buffer_length);
49
self->sample_end = self->sample_data + sample_buffer_length;
50
if (get_buffer_result == GET_BUFFER_DONE) {
51
if (self->loop) {
52
audiosample_reset_buffer(self->sample, false, 0);
- } else {
53
+ } else if (old_sample_data) {
54
self->stopping = true;
55
break;
56
}
0 commit comments