From b26cfcaf090a7c91dfc1aaec943f9b51ccebd8a5 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 7 Dec 2019 14:50:20 +0300 Subject: [PATCH] music_mad.c: remove the non-standard 'Extended ID3v1' tag support: none of the significant libraries like getID3, taglib, or libid3tag support it. not supported in most, if not all mp3 players, either. --- music_mad.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/music_mad.c b/music_mad.c index 0e626cd5..f2b988dc 100644 --- a/music_mad.c +++ b/music_mad.c @@ -140,17 +140,6 @@ static __inline__ SDL_bool is_id3v1(const unsigned char *data, int length) } return SDL_TRUE; } -static __inline__ SDL_bool is_id3v1ext(const unsigned char *data, int length) -{ - /* ID3v1 extended tag: just before ID3v1, always 227 bytes. - * https://www.getid3.org/phpBB3/viewtopic.php?t=1202 - * https://en.wikipedia.org/wiki/ID3v1#Enhanced_tag - * Not an official standard, is only supported by few programs. */ - if (length < 4 || SDL_memcmp(data,"TAG+",4) != 0) { - return SDL_FALSE; - } - return SDL_TRUE; -} static __inline__ SDL_bool is_id3v2(const unsigned char *data, int length) { /* ID3v2 header is 10 bytes: http://id3.org/id3v2.4.0-structure */ @@ -251,20 +240,7 @@ static int skip_tags(mad_data *music) if (is_id3v1(music->input_buffer, 128)) { music->length -= 128; - /* extended ID3v1 just before the ID3v1 tag? (unlikely) - * if found, assume no additional tags: this stupidity - * is non-standard.. */ - if (music->length < 227) goto ape; - MAD_RWseek(music, -227, RW_SEEK_END); - readsize = MAD_RWread(music, music->input_buffer, 1, 227); - MAD_RWseek(music, 0, RW_SEEK_SET); - if (readsize != 227) return -1; - if (is_id3v1ext(music->input_buffer, 227)) { - music->length -= 227; - goto end; - } - - /* FIXME: handle possible double-ID3v1 tags? */ + /* FIXME: handle possible double-ID3v1 tags?? */ } ape: /* APE tag may be at the end: read the footer */