summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorzlago2025-01-02 19:01:27 +0100
committerzlago2025-01-02 19:01:27 +0100
commit04cbd877cddabf1d7e4bbfd0f4f7553f6fc57899 (patch)
treef5ed3bcbb775613ccb723152f3bce5ff11673310 /src
parent156f638c6c16aeae921939c4cebfe43fc0668378 (diff)
tweaks
Diffstat (limited to 'src')
-rw-r--r--src/SDL2.c9
-rw-r--r--src/common/common.c2
-rw-r--r--src/portaudio.c5
3 files changed, 11 insertions, 5 deletions
diff --git a/src/SDL2.c b/src/SDL2.c
index 79b4e4a..04f9f08 100644
--- a/src/SDL2.c
+++ b/src/SDL2.c
@@ -85,7 +85,10 @@ int main(int argc, char **argv) {
 			perror(argv[1]);
 			goto arg_load_done;
 		}
-		module_func(&file, &userdata);
+		if (module_func(&file, &userdata)) {
+			eprintf("%s: failed to load\n", argv[1]);
+			userdata.callback = NULL;
+		}
 	}
 	arg_load_done:
 	
@@ -133,9 +136,8 @@ int main(int argc, char **argv) {
 						free(file.data);
 						break;
 					}
-					SDL_free(evt.drop.file);
 					if (module_func(&file, &newuser)) {
-						// error
+						eprintf("%s: failed to load\n", evt.drop.file);
 					} else {
 						SDL_LockAudioDevice(audio);
 						if (userdata.freefunc != NULL) {
@@ -145,6 +147,7 @@ int main(int argc, char **argv) {
 						SDL_UnlockAudioDevice(audio);
 					}
 					free(file.data);
+					SDL_free(evt.drop.file);
 					break;
 				
 				default:
diff --git a/src/common/common.c b/src/common/common.c
index 5ce79ad..a944f8f 100644
--- a/src/common/common.c
+++ b/src/common/common.c
@@ -8,7 +8,7 @@
 int (*file_ext(char *file))(struct blob *, struct userdata *) {
 	size_t len = strlen(file);
 	#define ext(extension) memcmp(file + len - sizeof (extension) + 1, extension, sizeof (extension))
-	if ((ext(".mptm") && ext(".mod") && ext(".MOD") && ext(".xm") && ext(".s3m") && ext(".it")) == 0) {
+	if ((ext(".mptm") && ext(".mod") && ext(".MOD") && ext(".xm") && ext(".s3m") && ext(".it") && ext(".oxm") && ext(".mo3")) == 0) {
 		return module_openmpt;
 	} else if ((ext(".mid") && ext(".MID") && ext(".midi")) == 0) {
 		return module_fluidsynth;
diff --git a/src/portaudio.c b/src/portaudio.c
index e8e9839..7ff6ca3 100644
--- a/src/portaudio.c
+++ b/src/portaudio.c
@@ -51,7 +51,10 @@ int main(int argc, char **argv) {
 			perror(argv[1]);
 			return EXIT_FAILURE;
 		}
-		module_func(&file, &userdata);
+		if (module_func(&file, &userdata)) {
+			eprintf("%s: failed to load\n", argv[1]);
+			return EXIT_FAILURE;
+		}
 	}
 	
 	signal(SIGINT, sigint_handler); // signal(3) claims this method is deprecated, but..