Commit d68ed4f8 authored by David Reid's avatar David Reid

Fix an initialization bug with the WinMM backend.

parent 18317050
...@@ -3787,8 +3787,6 @@ static mal_result mal_device_init__winmm(mal_context* pContext, mal_device_type ...@@ -3787,8 +3787,6 @@ static mal_result mal_device_init__winmm(mal_context* pContext, mal_device_type
wf.nChannels = (WORD)pConfig->channels; wf.nChannels = (WORD)pConfig->channels;
wf.nSamplesPerSec = (DWORD)pConfig->sampleRate; wf.nSamplesPerSec = (DWORD)pConfig->sampleRate;
wf.wBitsPerSample = (WORD)mal_get_sample_size_in_bytes(pConfig->format)*8; wf.wBitsPerSample = (WORD)mal_get_sample_size_in_bytes(pConfig->format)*8;
wf.nBlockAlign = (wf.nChannels * wf.wBitsPerSample) / 8;
wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec;
if (wf.nChannels > 2) { if (wf.nChannels > 2) {
wf.nChannels = 2; wf.nChannels = 2;
...@@ -4025,6 +4023,8 @@ static mal_result mal_device_init__winmm(mal_context* pContext, mal_device_type ...@@ -4025,6 +4023,8 @@ static mal_result mal_device_init__winmm(mal_context* pContext, mal_device_type
wf.wBitsPerSample = closestBitsPerSample; wf.wBitsPerSample = closestBitsPerSample;
wf.nChannels = closestChannels; wf.nChannels = closestChannels;
wf.nSamplesPerSec = closestSampleRate; wf.nSamplesPerSec = closestSampleRate;
wf.nBlockAlign = (wf.nChannels * wf.wBitsPerSample) / 8;
wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec;
// We use an event to know when a new fragment needs to be enqueued. // We use an event to know when a new fragment needs to be enqueued.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment