X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=72681647ed847bbfeba8edf3ea3172408532e22a;hb=7a821f79cb735d048869b503279c402800afa44a;hp=7ded74fb980289ec9d0e19c43d9de5d1b1c9534e;hpb=a95264fc39b6eae2473bfd6521c7bf3eef5af804;p=rocksndiamonds.git diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 7ded74fb..72681647 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -299,7 +299,7 @@ void UnixCloseAudio(void) if (audio.device_fd) close(audio.device_fd); - if (IS_PARENT_PROCESS()) + if (IS_PARENT_PROCESS() && HAS_CHILD_PROCESS()) kill(audio.mixer_pid, SIGTERM); } @@ -314,7 +314,7 @@ static void InitAudioDevice_Linux(struct AudioFormatInfo *afmt) /* "ioctl()" expects pointer to 'int' value for stereo flag (boolean is defined as 'char', which will not work here) */ unsigned int fragment_spec = 0; - int fragment_size_query; + int fragment_size_query = -1; int stereo = TRUE; struct { @@ -507,6 +507,8 @@ static void WriteReloadInfoToPipe(char *set_identifier, int type) if (leveldir_current == NULL) /* should never happen */ Error(ERR_EXIT, "leveldir_current == NULL"); + memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + snd_ctrl.active = FALSE; snd_ctrl.state = type; snd_ctrl.data_len = strlen(set_identifier) + 1; @@ -2038,6 +2040,8 @@ void PlaySoundExt(int nr, int volume, int stereo_position, int state) else if (stereo_position > SOUND_MAX_RIGHT) stereo_position = SOUND_MAX_RIGHT; + memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + snd_ctrl.active = TRUE; snd_ctrl.nr = nr; snd_ctrl.volume = volume; @@ -2092,6 +2096,8 @@ void StopSoundExt(int nr, int state) if (!audio.sound_available) return; + memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + snd_ctrl.active = FALSE; snd_ctrl.nr = nr; snd_ctrl.state = state;