openalbridge/openalbridge.c
changeset 2421 a4b039ee2eb0
parent 2419 dbaaba09146d
child 2437 10e4b5fc0d93
--- a/openalbridge/openalbridge.c	Sun Oct 11 20:40:03 2009 +0000
+++ b/openalbridge/openalbridge.c	Sun Oct 11 22:17:50 2009 +0000
@@ -74,7 +74,6 @@
                 
                 prog = programname;
                 
-                
                 /*Position of the listener*/
                 ALfloat ListenerPos[] = { 0.0, 0.0, 0.0 };
                 /*Velocity of the listener*/
@@ -88,7 +87,7 @@
                         return AL_FALSE;
                 }
                 
-                if (usehardware)
+                if (usehardware = AL_TRUE)
                         device = alcOpenDevice(NULL);
                 else
                         device = alcOpenDevice("Generic Software");
@@ -273,8 +272,9 @@
                 }
                 
                 /*Set volume for sound number index*/
-                if (index >= globalindex) {
-                        fprintf(stderr, "ERROR 'openal_setvolume()': index out of bounds (got %d, max %d)\n", index, globalindex);
+                if (index >= globalsize) {
+                        errno = EINVAL;
+                        err_ret("(%s) ERROR - Index out of bounds (got %d, max %d)", prog, index, globalindex);
                         return AL_FALSE;
                 }