returnmal_post_error(pDevice,"[DirectSound] Failed to set format of playback device's primary buffer.",MAL_FORMAT_NOT_SUPPORTED);
returnmal_post_error(pDevice,"[DirectSound] Failed to set format of playback device's primary buffer.",MAL_FORMAT_NOT_SUPPORTED);
}
}
// Get the _actual_ properties of the buffer. This is silly API design...
// Get the _actual_ properties of the buffer.
DWORD requiredSize;
if (FAILED(IDirectSoundBuffer_GetFormat((LPDIRECTSOUNDBUFFER)pDevice->dsound.pPlaybackPrimaryBuffer, NULL, 0, &requiredSize))) {
mal_device_uninit__dsound(pDevice);
return mal_post_error(pDevice, "[DirectSound] Failed to retrieve the actual format of the playback device's primary buffer.", MAL_FORMAT_NOT_SUPPORTED);
mal_uint8 temp[MAL_MAX_CHANNELS * MAL_MAX_SAMPLE_SIZE_IN_BYTES]; // Product of MAL_MAX_SAMPLE_SIZE_IN_BYTES to ensure it's large enough for all formats.
mal_uint8temp[MAL_MAX_CHANNELS*MAL_MAX_PCM_SAMPLE_SIZE_IN_BYTES];// Product of MAL_MAX_PCM_SAMPLE_SIZE_IN_BYTES to ensure it's large enough for all formats.