From b8f718cc291ead23886136aa838bc0bedb357f15 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 20 Feb 2015 08:48:28 +0100 Subject: [PATCH] [win32] - fix DirectSound for streams with very low sample rates --- xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp index 8b24703689140..8159ab8627e41 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp @@ -209,6 +209,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);