Skip to content

Commit

Permalink
[Var] minimp3: Update to fork <https://github.com/manxorist/minimp3/r…
Browse files Browse the repository at this point in the history
…eleases/tag/openmpt-2024-08-15-v3> commit 2811a29e4115199209fe91ae5217c9c5fc611fa6 (2024-08-15). This applies the following pull requests: <lieff/minimp3#125>.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@21446 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Aug 15, 2024
1 parent b712fe8 commit a628aa3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/minimp3/OpenMPT.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
minimp3 library from https://github.com/lieff/minimp3
Fork https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v2
commit 30b5aea9b6d000f197798ddd44476b641a4d0ba7 (2024-08-15)
Fork https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v3
commit 2811a29e4115199209fe91ae5217c9c5fc611fa6 (2024-08-15)
The following changes have been made:
* minimp3.c has been added
* The following pull rquests have been merged:
* https://github.com/lieff/minimp3/pull/126
* https://github.com/lieff/minimp3/pull/96
* https://github.com/lieff/minimp3/pull/97
* https://github.com/lieff/minimp3/pull/125
* all modifications are marked by /* OpenMPT */
17 changes: 17 additions & 0 deletions include/minimp3/minimp3.h
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,21 @@ static void mp3d_synth_granule(float *qmf_state, float *grbuf, int nbands, int n
}
}

static int hdr_is_tag(const uint8_t* hdr)
{
return hdr[0] == 'T' && hdr[1] == 'A' && hdr[2] == 'G' && hdr[3] == '\0';
}

static int hdr_is_null(const uint8_t* hdr)
{
return hdr[0] == '\0' && hdr[1] == '\0' && hdr[2] == '\0' && hdr[3] == '\0';
}

static int hdr_is_null_or_tag(const uint8_t* hdr)
{
return hdr_is_tag(hdr) > 0 || hdr_is_null(hdr) > 0;
}

static int mp3d_match_frame(const uint8_t *hdr, int mp3_bytes, int frame_bytes)
{
int i, nmatch;
Expand All @@ -1663,6 +1678,8 @@ static int mp3d_match_frame(const uint8_t *hdr, int mp3_bytes, int frame_bytes)
i += hdr_frame_bytes(hdr + i, frame_bytes) + hdr_padding(hdr + i);
if (i + HDR_SIZE > mp3_bytes)
return nmatch > 0;
if (hdr_is_null_or_tag(hdr + i))
return nmatch > 0;
if (!hdr_compare(hdr, hdr + i))
return 0;
}
Expand Down

0 comments on commit a628aa3

Please sign in to comment.