From 3fb9037d41fba909e4e484424e34e0f4d2fa1dd4 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Tue, 8 Oct 2019 01:50:02 +0300 Subject: [PATCH] minor simplification to file seek for opus detection. remove unused local. --- music.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/music.c b/music.c index ab03ded8..5efcd6a3 100644 --- a/music.c +++ b/music.c @@ -412,7 +412,6 @@ SDL_bool has_music(Mix_MusicType type) Mix_MusicType detect_music_type(SDL_RWops *src) { Uint8 magic[12]; - Mix_MusicType t; if (SDL_RWread(src, magic, 1, 12) != 12) { Mix_SetError("Couldn't read first 12 bytes of audio data"); @@ -429,10 +428,9 @@ Mix_MusicType detect_music_type(SDL_RWops *src) /* Ogg Vorbis files have the magic four bytes "OggS" */ if (SDL_memcmp(magic, "OggS", 4) == 0) { - Sint64 pos = SDL_RWtell(src); SDL_RWseek(src, 28, RW_SEEK_CUR); SDL_RWread(src, magic, 1, 8); - SDL_RWseek(src, pos, RW_SEEK_SET); + SDL_RWseek(src,-36, RW_SEEK_CUR); if (SDL_memcmp(magic, "OpusHead", 8) == 0) { return MUS_OPUS; }