]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_sdl.c
another WIN32_LEAN_AND_MEAN patch from Willis, this one for non-SDL client and dedica...
[xonotic/darkplaces.git] / snd_sdl.c
index 1b9ef7d641eb62e728a8a874ddfa98808645d62d..cfeeb1b49905c5259e990d14e40d1662e81d22fa 100644 (file)
--- a/snd_sdl.c
+++ b/snd_sdl.c
@@ -89,8 +89,22 @@ qboolean SNDDMA_Init(void)
                return false;
        }
 
-       for (channels = 8;channels >= 2;channels -= 2)
+       for (channels = 8;channels >= 1;channels--)
        {
+               if ((channels & 1) && channels != 1)
+                       continue;
+// COMMANDLINEOPTION: SDL Sound: -sndmono sets sound output to mono
+               if ((i=COM_CheckParm("-sndmono")) != 0)
+                       if (channels != 1)
+                               continue;
+// COMMANDLINEOPTION: SDL Sound: -sndstereo sets sound output to stereo
+               if ((i=COM_CheckParm("-sndstereo")) != 0)
+                       if (channels != 2)
+                               continue;
+// COMMANDLINEOPTION: SDL Sound: -sndquad sets sound output to 4 channel surround
+               if ((i=COM_CheckParm("-sndquad")) != 0)
+                       if (channels != 4)
+                               continue;
                // Init the SDL Audio subsystem
                wantspec.callback = Buffer_Callback;
                wantspec.userdata = NULL;
@@ -128,7 +142,7 @@ qboolean SNDDMA_Init(void)
                as.size = shm->bufferlength;
                break;
        }
-       if (channels < 2)
+       if (channels < 1)
        {
                Con_Print( "Failed to open the audio device!\n" );
                Con_DPrintf(