]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
Replaced all calls to str[n]cat and strncpy by calls to strlcat and strlcpy respectively
[xonotic/darkplaces.git] / snd_main.c
index 310a93b60fc3aa7533862314831676d8159769a3..a9b7f3aea04880b59bac33973911029e011b888b 100644 (file)
@@ -627,9 +627,12 @@ void S_Startup (void)
                           chosen_fmt.speed, chosen_fmt.channels, chosen_fmt.width * 8);
 
        // Update the cvars
-       snd_speed.integer = chosen_fmt.speed;
-       snd_width.integer = chosen_fmt.width;
-       snd_channels.integer = chosen_fmt.channels;
+       if (snd_speed.integer != (int)chosen_fmt.speed)
+               Cvar_SetValueQuick(&snd_speed, chosen_fmt.speed);
+       if (snd_width.integer != chosen_fmt.width)
+               Cvar_SetValueQuick(&snd_width, chosen_fmt.width);
+       if (snd_channels.integer != chosen_fmt.channels)
+               Cvar_SetValueQuick(&snd_channels, chosen_fmt.channels);
 
        current_channellayout_used = SND_CHANNELLAYOUT_AUTO;
        S_SetChannelLayout();