From: Holger Schemel Date: Sun, 7 Apr 2002 18:31:45 +0000 (+0200) Subject: rnd-20020407-4-src X-Git-Tag: 2.1.0^2~60 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e849e67ceff4a2f5d457dedee8f18de1646b9dc3;p=rocksndiamonds.git rnd-20020407-4-src --- diff --git a/src/libgame/sound.c b/src/libgame/sound.c index d10f0f2b..92c2253c 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -135,7 +135,7 @@ static boolean ForkAudioProcess(void) return FALSE; } - if (audio.soundserver_pid == 0) /* we are child */ + if (audio.soundserver_pid == 0) /* we are child process */ { SoundServer(); @@ -168,7 +168,7 @@ void UnixCloseAudio(void) if (audio.device_fd) close(audio.device_fd); - if (audio.soundserver_pid) + if (audio.soundserver_pid > 0) /* we are parent process */ kill(audio.soundserver_pid, SIGTERM); } #endif /* PLATFORM_UNIX */ @@ -1169,6 +1169,9 @@ void PlaySoundExt(int nr, int volume, int stereo, boolean loop) Mix_Volume(-1, SOUND_MAX_VOLUME); Mix_PlayChannel(-1, Sound[nr].mix_chunk, (loop ? -1 : 0)); #elif defined(PLATFORM_UNIX) + if (audio.soundserver_pid == 0) /* we are child process */ + return; + if (write(audio.soundserver_pipe[1], &snd_ctrl, sizeof(snd_ctrl)) < 0) { Error(ERR_WARN, "cannot pipe to child process -- no sounds"); @@ -1274,6 +1277,9 @@ void StopSoundExt(int nr, int method) #else #if !defined(PLATFORM_MSDOS) + if (audio.soundserver_pid == 0) /* we are child process */ + return; + if (write(audio.soundserver_pipe[1], &snd_ctrl, sizeof(snd_ctrl)) < 0) { Error(ERR_WARN, "cannot pipe to child process -- no sounds"); diff --git a/src/libgame/system.c b/src/libgame/system.c index fd0815b3..521e43f4 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -731,7 +731,7 @@ inline void OpenAudio(void) audio.sound_enabled = FALSE; audio.soundserver_pipe[0] = audio.soundserver_pipe[1] = 0; - audio.soundserver_pid = 0; + audio.soundserver_pid = -1; audio.device_name = NULL; audio.device_fd = 0; diff --git a/src/timestamp.h b/src/timestamp.h index 1078b58d..af1b9a59 100644 --- a/src/timestamp.h +++ b/src/timestamp.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-04-07 20:15]" +#define COMPILE_DATE_STRING "[2002-04-07 20:31]"