From fc0a1b5380c99a12c415e0dfb8bef49bed531300 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 13 Sep 2003 20:47:41 +0000 Subject: [PATCH] better fix --- stepmania/src/RageSoundReader_Vorbisfile.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/stepmania/src/RageSoundReader_Vorbisfile.cpp b/stepmania/src/RageSoundReader_Vorbisfile.cpp index 141a091a59..e4a3d69af2 100644 --- a/stepmania/src/RageSoundReader_Vorbisfile.cpp +++ b/stepmania/src/RageSoundReader_Vorbisfile.cpp @@ -140,7 +140,7 @@ int RageSoundReader_Vorbisfile::Read(char *buf, unsigned len) #if defined(INTEGER_OGG) int ret = ov_read(vf, tmpbuf, sizeof(tmpbuf), &bstream); #else // float vorbis decoder - int ret = ov_read(vf, tmpbuf, sizeof(tmpbuf), 0, 2, 1, &bstream); + int ret = ov_read(vf, tmpbuf, sizeof(tmpbuf), (SDL_BYTEORDER == SDL_BIG_ENDIAN)?1:0, 2, 1, &bstream); #endif //int ret = 4096; @@ -154,7 +154,7 @@ int RageSoundReader_Vorbisfile::Read(char *buf, unsigned len) } if(ret == 0) - return bytes_read; /* EOF */ + return bytes_read; /* If we have a different number of channels, we need to convert. */ ASSERT(vi->channels == 1 || vi->channels == 2); @@ -184,13 +184,6 @@ int RageSoundReader_Vorbisfile::Read(char *buf, unsigned len) bytes_read += size; } -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - /* I can't imagine why, but Vorbisfile returns data in little endian, not system-endian. */ - Sint16 *sbuf = (Sint16 *) buf; - for( int i = 0; i < bytes_read/2; ++i ) - sbuf[i] = SDL_Swap16(sbuf[i]); -#endif - return bytes_read; }