need to set dma.buffer to 0 so the sound devive gets mapped next time
	around.
snd_dma.c:
	register the commands after initializing the sound so that you don't
	get errors about already existing commands if the sound init failed a
	previous time around.
This commit is contained in:
Bill Currie 2002-04-13 02:44:13 +00:00
parent 2cd24175ce
commit e90942f9b5
2 changed files with 5 additions and 3 deletions

View file

@ -500,6 +500,7 @@ int SNDDMA_GetDMAPos(void) {
* Reset the sound device for exiting
*/
void SNDDMA_Shutdown(void) {
printf ("SNDDMA_Shutdown\n");
#if 0
if (snd_inited)
{
@ -526,6 +527,7 @@ void SNDDMA_Shutdown(void) {
}
} else {
munmap (dma.buffer, dma.samples *dma.samplebits / 8);
dma.buffer = 0L;
}
close(audio_fd);

View file

@ -132,14 +132,14 @@ void S_Init (void)
s_testsound = Cvar_Get ("s_testsound", "0", 0);
s_primary = Cvar_Get ("s_primary", "0", CVAR_ARCHIVE); // win32 specific
if (!SNDDMA_Init())
return;
Cmd_AddCommand("play", S_Play);
Cmd_AddCommand("stopsound", S_StopAllSounds);
Cmd_AddCommand("soundlist", S_SoundList);
Cmd_AddCommand("soundinfo", S_SoundInfo_f);
if (!SNDDMA_Init())
return;
S_InitScaletable ();
sound_started = 1;