Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
be1c8d16b7
|
@ -53,7 +53,7 @@
|
|||
*/
|
||||
STATIC bool mp3file_update_inbuf_always(audiomp3_mp3file_obj_t *self) {
|
||||
// If we didn't previously reach the end of file, we can try reading now
|
||||
if (!self->eof) {
|
||||
if (!self->eof && self->inbuf_offset != 0) {
|
||||
|
||||
// Move the unconsumed portion of the buffer to the start
|
||||
uint8_t *end_of_buffer = self->inbuf + self->inbuf_length;
|
||||
|
@ -356,6 +356,11 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
|
|||
return GET_BUFFER_DONE;
|
||||
}
|
||||
|
||||
self->samples_decoded += *buffer_length / sizeof(int16_t);
|
||||
|
||||
mp3file_skip_id3v2(self);
|
||||
int result = mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE;
|
||||
|
||||
if (self->inbuf_offset >= 512) {
|
||||
background_callback_add(
|
||||
&self->inbuf_fill_cb,
|
||||
|
@ -363,8 +368,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
|
|||
self);
|
||||
}
|
||||
|
||||
self->samples_decoded += *buffer_length / sizeof(int16_t);
|
||||
return mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE;
|
||||
return result;
|
||||
}
|
||||
|
||||
void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t *self, bool single_channel_output,
|
||||
|
|
Loading…
Reference in New Issue