Skip to content

Commit

Permalink
[win32] - fix DirectSound for streams with very low sample rates
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Feb 20, 2015
1 parent 2e5f353 commit b8f718c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b8f718c

Please sign in to comment.