aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/audio/sdl
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/audio/sdl')
-rw-r--r--src/libjin/audio/sdl/source.cpp7
-rw-r--r--src/libjin/audio/sdl/source.h4
2 files changed, 6 insertions, 5 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);
diff --git a/src/libjin/audio/sdl/source.h b/src/libjin/audio/sdl/source.h
index 900568f..743d4f0 100644
--- a/src/libjin/audio/sdl/source.h
+++ b/src/libjin/audio/sdl/source.h
@@ -22,8 +22,8 @@ namespace audio
~SDLSource();
- static SDLSource* createSource(SourceType format, const char* file);
- static SDLSource* createSource(SourceType format, void* mem, size_t size);
+ static SDLSource* createSource(const char* file);
+ static SDLSource* createSource(void* mem, size_t size);
/* ISource interface */
void play() override;