From b1c39b5698fb7d1e41d20111703a9133f1874e86 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 18 Oct 2007 02:27:55 +0000 Subject: [PATCH] Set cbSize in WAVEFORMATEX correctly, even though it's supposed to be ignored for PCM format, and don't include the unused flag for notification-event support in the buffer creation flags. Originally committed to SVN as r1604. --- aegisub/audio_player_dsound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/audio_player_dsound.cpp b/aegisub/audio_player_dsound.cpp index 5fb09e37f..7e3d00177 100644 --- a/aegisub/audio_player_dsound.cpp +++ b/aegisub/audio_player_dsound.cpp @@ -179,7 +179,7 @@ void DirectSoundPlayer::OpenStream() { waveFormat.wBitsPerSample = provider->GetBytesPerSample() * 8; waveFormat.nBlockAlign = waveFormat.nChannels * waveFormat.wBitsPerSample / 8; waveFormat.nAvgBytesPerSec = waveFormat.nSamplesPerSec * waveFormat.nBlockAlign; - waveFormat.cbSize = 0; + waveFormat.cbSize = sizeof(waveFormat); // Create the buffer initializer int aim = waveFormat.nAvgBytesPerSec * 15/100; // 150 ms buffer @@ -188,7 +188,7 @@ void DirectSoundPlayer::OpenStream() { bufSize = MIN(MAX(min,aim),max); DSBUFFERDESC desc; desc.dwSize = sizeof(DSBUFFERDESC); - desc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLPOSITIONNOTIFY; + desc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS; desc.dwBufferBytes = bufSize; desc.dwReserved = 0; desc.lpwfxFormat = &waveFormat;