-
Notifications
You must be signed in to change notification settings - Fork 213
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
Last frame + ID3v1 Tag #57
Comments
Also don't forget the possibility of an enhanced tag being present: |
Hello) Sorry for the delay. There no need to check ID3v1 in decoding loop, you can do it at the same place ID3v2 is handled. Here sample of skipping ID3v1 6fc51c3 . If condition is true, tag position to parse will be buf + buf_size - 128. Note that unlike ID3v2, ID3v1 detection is not 100% safe, there possibility that "TAG" marker accidentally found in middle of real mp3 frame, so I put it under define. |
Hello. Thank you for the reply and commit! The odds of "TAG" being in a frame exactly at buf_size - 128 should be low so I'll take the risk. I changed the code a bit to support enhanced tags: size_t id3v1size = 0;
#ifdef MINIMP3_SKIP_ID3V1
if (buf_size > 128 && !strncmp((char *)buf + buf_size - 128, "TAG", 3)) {
buf_size -= 128;
id3v1size += 128;
if (buf_size > 227 && !strncmp((char *)buf + buf_size - 227, "TAG+", 4)) {
buf_size -= 227;
id3v1size += 227;
}
}
#endif
info->id3v1size = id3v1size; What worries me about this solution is that I need to get all the frames in the MP3 file, but summing up all |
Oh, yes, I forgot about extended ID3v1 tag. I've add it here 43caa38 . |
According to Wikipedia, the extended block is not an official standard and is only supported by few programs, not including XMMS or Winamp. So it is no big deal. I will close this issue now, thank you very much for your help! |
Hello, I am a newbie to this library and am facing a problem that I'm not sure if it is my fault or the library's fault. I am trying to get the position of the ID3v1 tag in the file, if it exists. I am using the following code - based on the example provided in this repository - to get info regarding an MP3 file:
https://pastebin.com/3gghY7L3
https://pastebin.com/2iQb5FTz
The problem I'm facing is that the ID3v1 position is not set where the
TAG
starts, but where the last frame starts, which seems to be caused by the functionmp3dec_decode_frame
returning 0 samples for the last frame when there is an ID3v1 tag in the MP3 file. Any help?The text was updated successfully, but these errors were encountered: