We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4728 - music_mad.c: better skipping of tags:
Summary: music_mad.c: better skipping of tags:
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Ozkan Sezer
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-20 23:00 UTC by Ozkan Sezer
Modified: 2019-07-23 07:39 UTC (History)
0 users

See Also:


Attachments
music_mad.c patch for SDL2_mixer (11.90 KB, patch)
2019-07-20 23:00 UTC, Ozkan Sezer
Details | Diff
music_mad.c patch for SDL2_mixer (11.75 KB, patch)
2019-07-21 09:53 UTC, Ozkan Sezer
Details | Diff
music_mad.c patch for SDL_mixer-1.2 (12.32 KB, patch)
2019-07-21 09:54 UTC, Ozkan Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2019-07-20 23:00:09 UTC
Created attachment 3888 [details]
music_mad.c patch for SDL2_mixer

music_mad.c: better skipping of tags:

Instead of doing it 'as-we-go' every time, skip the tags at file-open
time only once.

The former implementation had the chance of not having the full tag in
the frame, that includes a possibility of even not having the complete
tag magic in the frame leading to not identifying a tag.

The new implementation skips all the tags at file-start and file-end,
and does that only once. That requires some local file data-start and
file-end bookkeeping for SDL_RWops which are added.

Also added are detection and skipping of extended ID3v1 and APEv1 tags.



OK to apply?  (Can easily backport to SDL-1.2 too.)
Comment 1 Ozkan Sezer 2019-07-21 09:53:50 UTC
Created attachment 3889 [details]
music_mad.c patch for SDL2_mixer

Slightly simplified patch.
Comment 2 Ozkan Sezer 2019-07-21 09:54:35 UTC
Created attachment 3890 [details]
music_mad.c patch for SDL_mixer-1.2

SDL-1.2 version of the patch.
Comment 3 Sam Lantinga 2019-07-23 00:06:55 UTC
Yup, this looks good to commit.
Comment 4 Ozkan Sezer 2019-07-23 07:39:59 UTC
Applied. SDL-1.2: http://hg.libsdl.org/SDL_mixer/rev/1f6c6389391a
default-2.0: http://hg.libsdl.org/SDL_mixer/rev/4e7795a92332