aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2015-02-20 08:48:28 +0100
committerRainer Hochecker <fernetmenta@online.de>2015-02-20 15:57:49 +0100
commitc445ab9c38d82399eb85d4bd55b0b87cdcfd7f69 (patch)
tree9123c21335945a2c3d3f4034bdfba86a16d89f1e
parent04acf2faff9d47f23bfa49d61bf674f2371d63c8 (diff)
[win32] - fix DirectSound for streams with very low sample rates
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
index 9725d6ee3d..9c91db6a99 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
@@ -207,6 +207,10 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)
WAVEFORMATEXTENSIBLE wfxex = {0};
+ // clamp samplerate to a minimum
+ if (format.m_sampleRate < 44100)
+ format.m_sampleRate = 44100;
+
//fill waveformatex
ZeroMemory(&wfxex, sizeof(WAVEFORMATEXTENSIBLE));
wfxex.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX);