summaryrefslogtreecommitdiff
path: root/src/sound/win32_s.cpp
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-05-20 18:40:11 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-06-10 23:17:29 +0200
commitf4c7d5577ed83d426371f86d780aed01c5370953 (patch)
tree0f8ed944d85cc7df95b699c96a28bebbced8b24d /src/sound/win32_s.cpp
parented3946e295f0e74880d85ffb6f6a933ca87e460d (diff)
downloadopenttd-f4c7d5577ed83d426371f86d780aed01c5370953.tar.xz
Codechange: [WIN32] Use VersionHelpers where appropriate
Diffstat (limited to 'src/sound/win32_s.cpp')
-rw-r--r--src/sound/win32_s.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sound/win32_s.cpp b/src/sound/win32_s.cpp
index eccbb4f42..87959e586 100644
--- a/src/sound/win32_s.cpp
+++ b/src/sound/win32_s.cpp
@@ -17,6 +17,7 @@
#include "win32_s.h"
#include <windows.h>
#include <mmsystem.h>
+#include <versionhelpers.h>
#include "../os/windows/win32.h"
#include "../thread.h"
@@ -69,7 +70,7 @@ const char *SoundDriver_Win32::Start(const StringList &parm)
wfex.nAvgBytesPerSec = wfex.nSamplesPerSec * wfex.nBlockAlign;
/* Limit buffer size to prevent overflows. */
- _bufsize = GetDriverParamInt(parm, "bufsize", (GB(GetVersion(), 0, 8) > 5) ? 8192 : 4096);
+ _bufsize = GetDriverParamInt(parm, "bufsize", IsWindowsVistaOrGreater() ? 8192 : 4096);
_bufsize = std::min<int>(_bufsize, UINT16_MAX);
try {