music_mad.c: remove the non-standard 'Extended ID3v1' tag support: SDL-1.2
authorOzkan Sezer
Sat, 07 Dec 2019 14:50:20 +0300
branchSDL-1.2
changeset 1059ce75343f3b96
parent 1057 9448cf5038cd
child 1061 ef8b9cf20828
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
     1.1 --- a/music_mad.c	Sat Dec 07 14:10:02 2019 +0300
     1.2 +++ b/music_mad.c	Sat Dec 07 14:50:20 2019 +0300
     1.3 @@ -140,17 +140,6 @@
     1.4      }
     1.5      return SDL_TRUE;
     1.6  }
     1.7 -static __inline__ SDL_bool is_id3v1ext(const unsigned char *data, int length)
     1.8 -{
     1.9 -    /* ID3v1 extended tag: just before ID3v1, always 227 bytes.
    1.10 -     * https://www.getid3.org/phpBB3/viewtopic.php?t=1202
    1.11 -     * https://en.wikipedia.org/wiki/ID3v1#Enhanced_tag
    1.12 -     * Not an official standard, is only supported by few programs. */
    1.13 -    if (length < 4 || SDL_memcmp(data,"TAG+",4) != 0) {
    1.14 -        return SDL_FALSE;
    1.15 -    }
    1.16 -    return SDL_TRUE;
    1.17 -}
    1.18  static __inline__ SDL_bool is_id3v2(const unsigned char *data, int length)
    1.19  {
    1.20      /* ID3v2 header is 10 bytes:  http://id3.org/id3v2.4.0-structure */
    1.21 @@ -251,20 +240,7 @@
    1.22      if (is_id3v1(music->input_buffer, 128)) {
    1.23          music->length -= 128;
    1.24  
    1.25 -        /* extended ID3v1 just before the ID3v1 tag? (unlikely)
    1.26 -         * if found, assume no additional tags: this stupidity
    1.27 -         * is non-standard..  */
    1.28 -        if (music->length < 227) goto ape;
    1.29 -        MAD_RWseek(music, -227, RW_SEEK_END);
    1.30 -        readsize = MAD_RWread(music, music->input_buffer, 1, 227);
    1.31 -        MAD_RWseek(music, 0, RW_SEEK_SET);
    1.32 -        if (readsize != 227) return -1;
    1.33 -        if (is_id3v1ext(music->input_buffer, 227)) {
    1.34 -            music->length -= 227;
    1.35 -            goto end;
    1.36 -        }
    1.37 -
    1.38 -        /* FIXME: handle possible double-ID3v1 tags? */
    1.39 +        /* FIXME: handle possible double-ID3v1 tags?? */
    1.40      }
    1.41  
    1.42      ape: /* APE tag may be at the end: read the footer */