File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 53
53
*/
54
54
STATIC bool mp3file_update_inbuf_always (audiomp3_mp3file_obj_t * self ) {
55
55
// If we didn't previously reach the end of file, we can try reading now
56
- if (!self -> eof ) {
56
+ if (!self -> eof && self -> inbuf_offset != 0 ) {
57
57
58
58
// Move the unconsumed portion of the buffer to the start
59
59
uint8_t * end_of_buffer = self -> inbuf + self -> inbuf_length ;
@@ -356,15 +356,19 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
356
356
return GET_BUFFER_DONE ;
357
357
}
358
358
359
+ self -> samples_decoded += * buffer_length / sizeof (int16_t );
360
+
361
+ mp3file_skip_id3v2 (self );
362
+ int result = mp3file_find_sync_word (self ) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE ;
363
+
359
364
if (self -> inbuf_offset >= 512 ) {
360
365
background_callback_add (
361
366
& self -> inbuf_fill_cb ,
362
367
mp3file_update_inbuf_cb ,
363
368
self );
364
369
}
365
370
366
- self -> samples_decoded += * buffer_length / sizeof (int16_t );
367
- return mp3file_find_sync_word (self ) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE ;
371
+ return result ;
368
372
}
369
373
370
374
void audiomp3_mp3file_get_buffer_structure (audiomp3_mp3file_obj_t * self , bool single_channel_output ,
You can’t perform that action at this time.
0 commit comments