Skip to content

Commit

Permalink
Merge pull request xbmc#25046 from thexai/fix-DirectSound-Win11
Browse files Browse the repository at this point in the history
[Windows] fix DirectSound buffer underrun with some Bluetooth audio devices
  • Loading branch information
thexai committed Apr 23, 2024
2 parents a5fb12b + 70226cb commit c92e0b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
Expand Up @@ -218,10 +218,10 @@ bool CAESinkDirectSound::Initialize(AEAudioFormat &format, std::string &device)

m_AvgBytesPerSec = wfxex.Format.nAvgBytesPerSec;

unsigned int uiFrameCount = (int)(format.m_sampleRate * 0.015); //default to 15ms chunks
const unsigned int uiFrameCount = static_cast<int>(format.m_sampleRate * 0.050); // 50ms chunks
m_dwFrameSize = wfxex.Format.nBlockAlign;
m_dwChunkSize = m_dwFrameSize * uiFrameCount;
m_dwBufferLen = m_dwChunkSize * 12; //180ms total buffer
m_dwBufferLen = m_dwChunkSize * 8; // 400ms total buffer

// fill in the secondary sound buffer descriptor
DSBUFFERDESC dsbdesc = {};
Expand Down

0 comments on commit c92e0b9

Please sign in to comment.