mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2024-12-12 13:42:21 +00:00
snd.c:
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:
parent
2cd24175ce
commit
e90942f9b5
2 changed files with 5 additions and 3 deletions
|
@ -500,6 +500,7 @@ int SNDDMA_GetDMAPos(void) {
|
||||||
* Reset the sound device for exiting
|
* Reset the sound device for exiting
|
||||||
*/
|
*/
|
||||||
void SNDDMA_Shutdown(void) {
|
void SNDDMA_Shutdown(void) {
|
||||||
|
printf ("SNDDMA_Shutdown\n");
|
||||||
#if 0
|
#if 0
|
||||||
if (snd_inited)
|
if (snd_inited)
|
||||||
{
|
{
|
||||||
|
@ -526,6 +527,7 @@ void SNDDMA_Shutdown(void) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
munmap (dma.buffer, dma.samples *dma.samplebits / 8);
|
munmap (dma.buffer, dma.samples *dma.samplebits / 8);
|
||||||
|
dma.buffer = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(audio_fd);
|
close(audio_fd);
|
||||||
|
|
|
@ -132,14 +132,14 @@ void S_Init (void)
|
||||||
s_testsound = Cvar_Get ("s_testsound", "0", 0);
|
s_testsound = Cvar_Get ("s_testsound", "0", 0);
|
||||||
s_primary = Cvar_Get ("s_primary", "0", CVAR_ARCHIVE); // win32 specific
|
s_primary = Cvar_Get ("s_primary", "0", CVAR_ARCHIVE); // win32 specific
|
||||||
|
|
||||||
|
if (!SNDDMA_Init())
|
||||||
|
return;
|
||||||
|
|
||||||
Cmd_AddCommand("play", S_Play);
|
Cmd_AddCommand("play", S_Play);
|
||||||
Cmd_AddCommand("stopsound", S_StopAllSounds);
|
Cmd_AddCommand("stopsound", S_StopAllSounds);
|
||||||
Cmd_AddCommand("soundlist", S_SoundList);
|
Cmd_AddCommand("soundlist", S_SoundList);
|
||||||
Cmd_AddCommand("soundinfo", S_SoundInfo_f);
|
Cmd_AddCommand("soundinfo", S_SoundInfo_f);
|
||||||
|
|
||||||
if (!SNDDMA_Init())
|
|
||||||
return;
|
|
||||||
|
|
||||||
S_InitScaletable ();
|
S_InitScaletable ();
|
||||||
|
|
||||||
sound_started = 1;
|
sound_started = 1;
|
||||||
|
|
Loading…
Reference in a new issue