minor simplification to file seek for opus detection. remove unused local. default tip
authorOzkan Sezer <sezeroz@gmail.com>
Tue, 08 Oct 2019 01:50:02 +0300
changeset 959e1919e398c29
parent 958 4641084da786
minor simplification to file seek for opus detection. remove unused local.
music.c
     1.1 --- a/music.c	Mon Oct 07 01:04:02 2019 +0300
     1.2 +++ b/music.c	Tue Oct 08 01:50:02 2019 +0300
     1.3 @@ -412,7 +412,6 @@
     1.4  Mix_MusicType detect_music_type(SDL_RWops *src)
     1.5  {
     1.6      Uint8 magic[12];
     1.7 -    Mix_MusicType t;
     1.8  
     1.9      if (SDL_RWread(src, magic, 1, 12) != 12) {
    1.10          Mix_SetError("Couldn't read first 12 bytes of audio data");
    1.11 @@ -429,10 +428,9 @@
    1.12  
    1.13      /* Ogg Vorbis files have the magic four bytes "OggS" */
    1.14      if (SDL_memcmp(magic, "OggS", 4) == 0) {
    1.15 -        Sint64 pos = SDL_RWtell(src);
    1.16          SDL_RWseek(src, 28, RW_SEEK_CUR);
    1.17          SDL_RWread(src, magic, 1, 8);
    1.18 -        SDL_RWseek(src, pos, RW_SEEK_SET);
    1.19 +        SDL_RWseek(src,-36, RW_SEEK_CUR);
    1.20          if (SDL_memcmp(magic, "OpusHead", 8) == 0) {
    1.21              return MUS_OPUS;
    1.22          }