MP3: look harder for frame info

Apparently sometimes, a proper "frame info" block is not found after
a "sync word".  Keep looking for one as needed, instead of giving up
after one try.

This was one reason that the "bartlebeats" mp3s would not play.
This commit is contained in:
Jeff Epler 2019-12-13 15:20:48 -06:00
parent bf9b7e7ece
commit 91a1706160

View File

@ -139,7 +139,15 @@ STATIC bool mp3file_find_sync_word(audiomp3_mp3file_obj_t* self) {
}
STATIC bool mp3file_get_next_frame_info(audiomp3_mp3file_obj_t* self, MP3FrameInfo* fi) {
int err = MP3GetNextFrameInfo(self->decoder, fi, READ_PTR(self));
int err;
do {
err = MP3GetNextFrameInfo(self->decoder, fi, READ_PTR(self));
if (err == ERR_MP3_NONE) {
break;
}
CONSUME(self, 1);
mp3file_find_sync_word(self);
} while (!self->eof);
return err == ERR_MP3_NONE;
}