shithub: qk1

Download patch

ref: 56e986af5da86d60abb752209096720902829139
parent: c03ebff7de31f1208b35130e36be60f7c774ba2d
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Dec 26 21:49:22 EST 2023

openal: if wavinfo says it's a bad file, use silence

--- a/unix/snd_openal.c
+++ b/unix/snd_openal.c
@@ -202,7 +202,12 @@
 	}
 	if(wavinfo(in, len, &info) != 0){
 		Con_Printf("loadsfx: %s: %s\n", sfx->s, lerr());
-		return nil;
+		// complain but get some silence in place so it looks like it got loaded
+		memset(&info, 0, sizeof(info));
+		info.width = 8;
+		info.channels = 1;
+		info.rate = 11025;
+		info.loopofs = -1;
 	}
 	if(info.channels < 2)
 		fmt = info.width == 1 ? AL_FORMAT_MONO8 : AL_FORMAT_MONO16;