From e024e5a23c4f5c8e8fb02e7b03c8e9265ac6c1ef Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 29 May 2018 12:39:52 +0800 Subject: =?UTF-8?q?Image=E6=94=B9=E4=B8=BA=E5=B7=A5=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/audio/sdl/source.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libjin/audio/sdl/source.cpp') diff --git a/src/libjin/audio/sdl/source.cpp b/src/libjin/audio/sdl/source.cpp index 2bb63f5..b647229 100644 --- a/src/libjin/audio/sdl/source.cpp +++ b/src/libjin/audio/sdl/source.cpp @@ -54,7 +54,7 @@ namespace audio shared std::vector Manager::sources; shared Manager* Manager::manager = nullptr; - SDLSource* SDLSource::createSource(SourceType format, const char* file) + SDLSource* SDLSource::createSource(const char* file) { std::ifstream fs; fs.open(file, std::ios::binary); @@ -69,12 +69,12 @@ namespace audio char* buffer = (char*)malloc(size); memset(buffer, 0, size); fs.read(buffer, size); - SDLSource* source = createSource(format, buffer, size); + SDLSource* source = createSource(buffer, size); free(buffer); return source; } - SDLSource* SDLSource::createSource(SourceType format, void* mem, size_t size) + SDLSource* SDLSource::createSource(void* mem, size_t size) { if (mem == nullptr) return nullptr; @@ -82,6 +82,7 @@ namespace audio #define read(FMT) case FMT : source->load##FMT(mem, size); break try { + SourceType format = getType(mem, size); switch (format) { read(OGG); -- cgit v1.1-26-g67d0