From 16d7152b8a9476930c0b21d6b6722b5a95a8bc46 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 30 Jan 2006 13:01:34 +0000 Subject: [PATCH] patch from div0 to add -sndmono and -sndstereo options to sdl sound code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5925 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_sdl.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/snd_sdl.c b/snd_sdl.c index 1b9ef7d6..5e4157e6 100644 --- a/snd_sdl.c +++ b/snd_sdl.c @@ -89,8 +89,18 @@ 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; // Init the SDL Audio subsystem wantspec.callback = Buffer_Callback; wantspec.userdata = NULL; @@ -128,7 +138,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( -- 2.39.2