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) {
4242    while  (!self -> stopping  &&  output_buffer_size  >  0 ) {
4343        if  (self -> sample_data  ==  self -> sample_end ) {
4444            uint32_t  sample_buffer_length ;
45+             uint8_t  * old_sample_data  =  self -> sample_data ;
4546            audioio_get_buffer_result_t  get_buffer_result  = 
4647                audiosample_get_buffer (self -> sample , false, 0 ,
4748                    & self -> sample_data , & sample_buffer_length );
4849            self -> sample_end  =  self -> sample_data  +  sample_buffer_length ;
4950            if  (get_buffer_result  ==  GET_BUFFER_DONE ) {
5051                if  (self -> loop ) {
5152                    audiosample_reset_buffer (self -> sample , false, 0 );
52-                 } else  {
53+                 } else  if  ( old_sample_data )  {
5354                    self -> stopping  =  true;
5455                    break ;
5556                }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments