From 2eab12e43c040d369b685efc13e2452405cf6451 Mon Sep 17 00:00:00 2001 From: zlago Date: Sun, 1 Sep 2024 17:41:03 +0200 Subject: tweaks --- src/modules/openmpt.c | 8 +++----- src/modules/openmpt.h | 2 -- 2 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 src/modules/openmpt.h (limited to 'src/modules') 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 +#include #include "../include.h" #include -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); -- cgit 1.4.1-2-gfad0