X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=72681647ed847bbfeba8edf3ea3172408532e22a;hp=0299521267dd802ccd5024467a15590fb286ed22;hb=7a821f79cb735d048869b503279c402800afa44a;hpb=c42450df0ac6ff7b6db97bf0df12b9c73055c727 diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 02995212..72681647 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -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;