Merge remote-tracking branch 'origin/main'

This commit is contained in:
Hosted Weblate 2022-04-24 14:33:57 +02:00
commit be1c8d16b7
No known key found for this signature in database
GPG Key ID: A3FAAA06E6569B4C
1 changed files with 7 additions and 3 deletions

View File

@ -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,