From ed5c120bc97e8bd45519a28ceaf7a28074ea6c44 Mon Sep 17 00:00:00 2001 From: everything411 Date: Fri, 27 Oct 2023 21:28:29 +0800 Subject: [PATCH] fix(audio:windows): set cbSize correctly (#1787) --- src/platform/windows/audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/windows/audio.cpp b/src/platform/windows/audio.cpp index c02f1626fd6..1311a694fd1 100644 --- a/src/platform/windows/audio.cpp +++ b/src/platform/windows/audio.cpp @@ -156,7 +156,7 @@ namespace platf::audio { wave_format.Format.wBitsPerSample = 16; wave_format.Format.nBlockAlign = wave_format.Format.nChannels * wave_format.Format.wBitsPerSample / 8; wave_format.Format.nAvgBytesPerSec = wave_format.Format.nSamplesPerSec * wave_format.Format.nBlockAlign; - wave_format.Format.cbSize = sizeof(wave_format); + wave_format.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); wave_format.Samples.wValidBitsPerSample = 16; wave_format.dwChannelMask = format.channel_mask;