-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDL3] Fixed detection of FLAC files with ID3 tag at begin and extending MP3 detection #527
base: main
Are you sure you want to change the base?
Conversation
Like I said in original commit: The idea of FLAC files with ID3 tags?? This may be one way of handling it. (Labeling a file starting with ID3 |
Maybe use my own implementation of I mean, call it after skipping the ID3 tag (and inside the I polished it for many years on thousands of various MP3 files that I had at my personal collections. Does this sounds better? Also: put the detect_mp3 calling into the LOWEST position of the whole list to ensure all previous checks hadn't detected any known file format, like I did at MixerX. |
And I wonder: how much should we care about flac files with id3? CC: @ktmf01 as libflac maintainer. |
At the mainstream FLAC I also do see the code that skips ID3 tags: https://github.com/xiph/flac/blob/1619af5a36fc0343cdf6b3517bb78d8aee85fe59/src/libFLAC/metadata_iterators.c#L3143-L3176 And at the changelog I see, the ID3 tags were being supported in the past, but had been removed, and now, if any FLAC file contains these tags, they just gets skipped. Basically to keep compatibility to let any modern player keep opening these old files. |
We're talking almost 19 years ago here. Support from plugins was removed in October 2004, and the command line programs never supported reading or writing them, only skipping them. There are a few programs around that are able to are able to transcode ID3v1 and ID3v2 to FLAC tags. edit: the |
My patch doesn't adds support: it adds skipping as all current FLAC implementations. Without this patch, all these FLAC files gets recognised as MP3 files which obviously gets refused as invalid by MP3 decoders. Also, recently at MixerX I slightly tweaked my code to also process the check for MP3 frames after ID3 tag to ensure that it's really an MP3 file and not something also. I could extend this patch by these changes I did. |
The problem is that FLAC files with an ID3v2 block are not valid, according to the FLAC spec. Now, the But 'salvaging' broken files is something that is expected of the |
I talked about the library |
c24c210
to
43a8d0c
Compare
Rebased the thing. |
43a8d0c
to
24e3ee2
Compare
Just now I rebased these changes to the latest state. |
Recently I found that some FLAC files won't play at all. I had checked, and I found it begins with an ID3 tag. Also, I checked around the stuff, and it's not a paranomrmal mess of Audacity: it's one of legacy forms of FLAC files that used ID3 tags at begin.
There is a comment where I explained about this a first time: WohlSoft/SDL-Mixer-X@94e8750
Example file (I exported it in 2019'th year by the old version of Audacity): Fox fantasy.mid-battle-chess-gmized.flac.zip
Also, I had to extended the MP3 detection code to ensure that more MP3 files will be properly detected: