mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 09:14:04 +02:00
audio(4): Properly set the exclusive mode flag.
This commit is contained in:
@@ -16907,6 +16907,16 @@ mal_result mal_device_init__audio4(mal_context* pContext, mal_device_type device
|
|||||||
mal_get_standard_channel_map(mal_standard_channel_map_sound4, pDevice->internalChannels, pDevice->internalChannelMap);
|
mal_get_standard_channel_map(mal_standard_channel_map_sound4, pDevice->internalChannels, pDevice->internalChannelMap);
|
||||||
|
|
||||||
|
|
||||||
|
// The version of the operating system dictates whether or not the device is exclusive or shared. NetBSD
|
||||||
|
// introduced in-kernel mixing which means it's shared. All other BSD flavours are exclusive as far as
|
||||||
|
// I'm aware.
|
||||||
|
#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 800000000
|
||||||
|
pDevice->exclusiveMode = MAL_FALSE;
|
||||||
|
#else
|
||||||
|
pDevice->exclusiveMode = MAL_TRUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// When not using MMAP mode we need to use an intermediary buffer to the data transfer between the client
|
// When not using MMAP mode we need to use an intermediary buffer to the data transfer between the client
|
||||||
// and device. Everything is done by the size of a fragment.
|
// and device. Everything is done by the size of a fragment.
|
||||||
pDevice->audio4.pIntermediaryBuffer = mal_malloc(pDevice->audio4.fragmentSizeInFrames * mal_get_bytes_per_frame(pDevice->internalFormat, pDevice->internalChannels));
|
pDevice->audio4.pIntermediaryBuffer = mal_malloc(pDevice->audio4.fragmentSizeInFrames * mal_get_bytes_per_frame(pDevice->internalFormat, pDevice->internalChannels));
|
||||||
|
|||||||
Reference in New Issue
Block a user