Skip to content

Commit

Permalink
[Windows] fix DirectSound buffer underrun with some BT audio devices
Browse files Browse the repository at this point in the history
  • Loading branch information
thexai committed Apr 22, 2024
1 parent c48c9e6 commit 70226cb
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 70226cb

Please sign in to comment.