From db1ee0cae641b48467dee6ec81f75df5c3476de0 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 27 Jan 2022 15:32:52 +0100 Subject: [PATCH] Update nAvgBytesPerSec in audin_winmm_set_format The format channel count and alignment may have changed. Update nAvgBytesPerSec accordingly --- channels/audin/client/winmm/audin_winmm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/channels/audin/client/winmm/audin_winmm.c b/channels/audin/client/winmm/audin_winmm.c index a277cf9a3..d9024b107 100644 --- a/channels/audin/client/winmm/audin_winmm.c +++ b/channels/audin/client/winmm/audin_winmm.c @@ -350,7 +350,9 @@ static UINT audin_winmm_set_format(IAudinDevice* device, const AUDIO_FORMAT* for if (ppwfx->nBlockAlign != 2) { ppwfx->nBlockAlign = 2; + ppwfx->nAvgBytesPerSec = ppwfx->nSamplesPerSec * ppwfx->nBlockAlign; } + if (!test_format_supported(ppwfx)) return ERROR_INVALID_PARAMETER; winmm->pwfx_cur = ppwfx;