diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/openmpt.c | 8 | ||||
-rw-r--r-- | src/modules/openmpt.h | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/modules/openmpt.c b/src/modules/openmpt.c index ee63731..58c3994 100644 --- a/src/modules/openmpt.c +++ b/src/modules/openmpt.c @@ -1,9 +1,9 @@ -#include <SDL2/SDL.h> +#include <stdio.h> #include "../include.h" #include <libopenmpt/libopenmpt.h> -void openmpt_callback(void *mod, unsigned char *stream, int const length) { +static void openmpt_callback(void *mod, unsigned char *stream, int const length) { openmpt_module_read_interleaved_float_stereo(mod, 48000, length / sizeof (float) / 2, (float *) stream); } @@ -11,7 +11,7 @@ static void libopenmpt_example_logfunc( const char * message, void * userdata ); static int libopenmpt_example_errfunc( int error, void * userdata ); static void libopenmpt_example_print_error( const char * func_name, int mod_err, const char * mod_err_str ); -int module_openmpt(struct blob *file, SDL_AudioDeviceID audio, struct userdata *userdata) { +int module_openmpt(struct blob *file, struct userdata *userdata) { int mod_err = OPENMPT_ERROR_OK; const char *mod_err_str = NULL; openmpt_module *mod = openmpt_module_create_from_memory2(file->data, file->size, &libopenmpt_example_logfunc, NULL, &libopenmpt_example_errfunc, NULL, &mod_err, &mod_err_str, NULL); @@ -21,11 +21,9 @@ int module_openmpt(struct blob *file, SDL_AudioDeviceID audio, struct userdata * return 1; } openmpt_module_set_repeat_count(mod, -1); - SDL_LockAudioDevice(audio); userdata->callback = openmpt_callback; userdata->user = mod; userdata->freefunc = (void (*)(void *)) openmpt_module_destroy; - SDL_UnlockAudioDevice(audio); return 0; } diff --git a/src/modules/openmpt.h b/src/modules/openmpt.h deleted file mode 100644 index 3daa7cd..0000000 --- a/src/modules/openmpt.h +++ /dev/null @@ -1,2 +0,0 @@ -#include "../include.h" -int module_openmpt(struct blob *file, SDL_AudioDeviceID audio, struct userdata *userdata); |