Skip to content

Commit

Permalink
Merge pull request xbmc#6496 from FernetMenta/dsfix
Browse files Browse the repository at this point in the history
[win32] - fix DirectSound for streams with very low sample rates
  • Loading branch information
FernetMenta committed Feb 20, 2015
2 parents 13bbce3 + b8f718c commit 435c6c6
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 435c6c6

Please sign in to comment.