X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=72681647ed847bbfeba8edf3ea3172408532e22a;hb=bc1e7fc2edb32a410dfa7cf098933010d5014761;hp=d5bd45b4d6034cda46c09d7bfd749402df5a0a18;hpb=84a3ee86461e2311032274e0b7d7a857e02a76ab;p=rocksndiamonds.git diff --git a/src/libgame/sound.c b/src/libgame/sound.c index d5bd45b4..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; @@ -1834,7 +1836,7 @@ void InitSoundList(struct ConfigInfo *config_list, int num_file_list_entries, sound_info->num_dynamic_file_list_entries = 0; sound_info->file_list = - getFileListFromConfigList(config_list, config_suffix_list, + getFileListFromConfigList(config_list, config_suffix_list, ignore_tokens, num_file_list_entries); sound_info->dynamic_file_list = NULL; @@ -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;