Update nAvgBytesPerSec in audin_winmm_set_format

The format channel count and alignment may have changed.
Update nAvgBytesPerSec accordingly
This commit is contained in:
akallabeth
2022-01-27 15:32:52 +01:00
committed by akallabeth
parent 8560803211
commit db1ee0cae6

View File

@@ -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;