aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/audio/sdl/source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/audio/sdl/source.cpp')
-rw-r--r--src/libjin/audio/sdl/source.cpp7
1 files changed, 4 insertions, 3 deletions
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<SDLSource*> 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);