File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
ports/espressif/common-hal/audiobusio Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,15 @@ static void i2s_fill_buffer(i2s_t *self) {
42
42
while (!self -> stopping && output_buffer_size > 0 ) {
43
43
if (self -> sample_data == self -> sample_end ) {
44
44
uint32_t sample_buffer_length ;
45
+ uint8_t * old_sample_data = self -> sample_data ;
45
46
audioio_get_buffer_result_t get_buffer_result =
46
47
audiosample_get_buffer (self -> sample , false, 0 ,
47
48
& self -> sample_data , & sample_buffer_length );
48
49
self -> sample_end = self -> sample_data + sample_buffer_length ;
49
50
if (get_buffer_result == GET_BUFFER_DONE ) {
50
51
if (self -> loop ) {
51
52
audiosample_reset_buffer (self -> sample , false, 0 );
52
- } else {
53
+ } else if ( old_sample_data ) {
53
54
self -> stopping = true;
54
55
break ;
55
56
}
You can’t perform that action at this time.
0 commit comments