aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2015-02-21 13:23:23 +0100
committerMartijn Kaijser <martijn@xbmc.org>2015-02-21 13:23:23 +0100
commit085163e0d028a95259ae62d60ed7fc9446e8a865 (patch)
tree9123c21335945a2c3d3f4034bdfba86a16d89f1e
parent04acf2faff9d47f23bfa49d61bf674f2371d63c8 (diff)
parentc445ab9c38d82399eb85d4bd55b0b87cdcfd7f69 (diff)
Merge pull request #6501 from FernetMenta/dsfix
[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);