Commit 30c41c76 authored by David Reid's avatar David Reid

Rename ma_get_standard_channel_map() to ma_channel_map_init_standard().

parent 405fc1ab
...@@ -415,7 +415,7 @@ MA_API ma_result ma_libopus_get_data_format(ma_libopus* pOpus, ma_format* pForma ...@@ -415,7 +415,7 @@ MA_API ma_result ma_libopus_get_data_format(ma_libopus* pOpus, ma_format* pForma
} }
if (pChannelMap != NULL) { if (pChannelMap != NULL) {
ma_get_standard_channel_map(ma_standard_channel_map_vorbis, pChannelMap, channelMapCap, channels); ma_channel_map_init_standard(ma_standard_channel_map_vorbis, pChannelMap, channelMapCap, channels);
} }
return MA_SUCCESS; return MA_SUCCESS;
......
...@@ -435,7 +435,7 @@ MA_API ma_result ma_libvorbis_get_data_format(ma_libvorbis* pVorbis, ma_format* ...@@ -435,7 +435,7 @@ MA_API ma_result ma_libvorbis_get_data_format(ma_libvorbis* pVorbis, ma_format*
} }
if (pChannelMap != NULL) { if (pChannelMap != NULL) {
ma_get_standard_channel_map(ma_standard_channel_map_vorbis, pChannelMap, channelMapCap, pInfo->channels); ma_channel_map_init_standard(ma_standard_channel_map_vorbis, pChannelMap, channelMapCap, pInfo->channels);
} }
return MA_SUCCESS; return MA_SUCCESS;
......
...@@ -1559,7 +1559,7 @@ Finally, the `ma_channel_mix_mode_custom_weights` mode can be used to use custom ...@@ -1559,7 +1559,7 @@ Finally, the `ma_channel_mix_mode_custom_weights` mode can be used to use custom
weights. Custom weights can be passed in as the last parameter of weights. Custom weights can be passed in as the last parameter of
`ma_channel_converter_config_init()`. `ma_channel_converter_config_init()`.
Predefined channel maps can be retrieved with `ma_get_standard_channel_map()`. This takes a Predefined channel maps can be retrieved with `ma_channel_map_init_standard()`. This takes a
`ma_standard_channel_map` enum as it's first parameter, which can be one of the following: `ma_standard_channel_map` enum as it's first parameter, which can be one of the following:
+-----------------------------------+-----------------------------------------------------------+ +-----------------------------------+-----------------------------------------------------------+
...@@ -1782,7 +1782,7 @@ Something like the following may be more suitable depending on your requirements ...@@ -1782,7 +1782,7 @@ Something like the following may be more suitable depending on your requirements
config.channelsOut = outputChannels; config.channelsOut = outputChannels;
config.sampleRateIn = inputSampleRate; config.sampleRateIn = inputSampleRate;
config.sampleRateOut = outputSampleRate; config.sampleRateOut = outputSampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_flac, config.channelMapIn, sizeof(config.channelMapIn)/sizeof(config.channelMapIn[0]), config.channelCountIn); ma_channel_map_init_standard(ma_standard_channel_map_flac, config.channelMapIn, sizeof(config.channelMapIn)/sizeof(config.channelMapIn[0]), config.channelCountIn);
config.resampling.linear.lpfOrder = MA_MAX_FILTER_ORDER; config.resampling.linear.lpfOrder = MA_MAX_FILTER_ORDER;
``` ```
...@@ -3810,14 +3810,14 @@ Initializes a blank channel map. ...@@ -3810,14 +3810,14 @@ Initializes a blank channel map.
When a blank channel map is specified anywhere it indicates that the native channel map should be used. When a blank channel map is specified anywhere it indicates that the native channel map should be used.
*/ */
MA_API void ma_channel_map_init_blank(ma_uint32 channels, ma_channel* pChannelMap); MA_API void ma_channel_map_init_blank(ma_channel* pChannelMap, ma_uint32 channels);
/* /*
Helper for retrieving a standard channel map. Helper for retrieving a standard channel map.
The output channel map buffer must have a capacity of at least `channelMapCap`. The output channel map buffer must have a capacity of at least `channelMapCap`.
*/ */
MA_API void ma_get_standard_channel_map(ma_standard_channel_map standardChannelMap, ma_channel* pChannelMap, size_t channelMapCap, ma_uint32 channels); MA_API void ma_channel_map_init_standard(ma_standard_channel_map standardChannelMap, ma_channel* pChannelMap, size_t channelMapCap, ma_uint32 channels);
/* /*
Copies a channel map. Copies a channel map.
...@@ -3855,14 +3855,14 @@ This assumes the channel count is the same between the two. ...@@ -3855,14 +3855,14 @@ This assumes the channel count is the same between the two.
Both channels map buffers must have a capacity of at least `channels`. Both channels map buffers must have a capacity of at least `channels`.
*/ */
MA_API ma_bool32 ma_channel_map_equal(ma_uint32 channels, const ma_channel* pChannelMapA, const ma_channel* pChannelMapB); MA_API ma_bool32 ma_channel_map_is_equal(const ma_channel* pChannelMapA, const ma_channel* pChannelMapB, ma_uint32 channels);
/* /*
Helper for determining if a channel map is blank (all channels set to MA_CHANNEL_NONE). Helper for determining if a channel map is blank (all channels set to MA_CHANNEL_NONE).
The channel map buffer must have a capacity of at least `channels`. The channel map buffer must have a capacity of at least `channels`.
*/ */
MA_API ma_bool32 ma_channel_map_blank(ma_uint32 channels, const ma_channel* pChannelMap); MA_API ma_bool32 ma_channel_map_is_blank(const ma_channel* pChannelMap, ma_uint32 channels);
/* /*
Helper for determining whether or not a channel is present in the given channel map. Helper for determining whether or not a channel is present in the given channel map.
...@@ -4555,7 +4555,7 @@ internally by miniaudio. ...@@ -4555,7 +4555,7 @@ internally by miniaudio.
On input, if the sample format is set to `ma_format_unknown`, the backend is free to use whatever sample format it desires, so long as it's On input, if the sample format is set to `ma_format_unknown`, the backend is free to use whatever sample format it desires, so long as it's
supported by miniaudio. When the channel count is set to 0, the backend should use the device's native channel count. The same applies for supported by miniaudio. When the channel count is set to 0, the backend should use the device's native channel count. The same applies for
sample rate. For the channel map, the default should be used when `ma_channel_map_blank()` returns true (all channels set to sample rate. For the channel map, the default should be used when `ma_channel_map_is_blank()` returns true (all channels set to
`MA_CHANNEL_NONE`). On input, the `periodSizeInFrames` or `periodSizeInMilliseconds` option should always be set. The backend should `MA_CHANNEL_NONE`). On input, the `periodSizeInFrames` or `periodSizeInMilliseconds` option should always be set. The backend should
inspect both of these variables. If `periodSizeInFrames` is set, it should take priority, otherwise it needs to be derived from the period inspect both of these variables. If `periodSizeInFrames` is set, it should take priority, otherwise it needs to be derived from the period
size in milliseconds (`periodSizeInMilliseconds`) and the sample rate, keeping in mind that the sample rate may be 0, in which case the size in milliseconds (`periodSizeInMilliseconds`) and the sample rate, keeping in mind that the sample rate may be 0, in which case the
...@@ -15883,7 +15883,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config ...@@ -15883,7 +15883,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config
pDescriptorCapture->sampleRate = (pDescriptorCapture->sampleRate != 0) ? pDescriptorCapture->sampleRate : MA_DEFAULT_SAMPLE_RATE; pDescriptorCapture->sampleRate = (pDescriptorCapture->sampleRate != 0) ? pDescriptorCapture->sampleRate : MA_DEFAULT_SAMPLE_RATE;
if (pDescriptorCapture->channelMap[0] == MA_CHANNEL_NONE) { if (pDescriptorCapture->channelMap[0] == MA_CHANNEL_NONE) {
ma_get_standard_channel_map(ma_standard_channel_map_default, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorCapture->channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorCapture->channels);
} }
pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile); pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile);
...@@ -15895,7 +15895,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config ...@@ -15895,7 +15895,7 @@ static ma_result ma_device_init__null(ma_device* pDevice, const ma_device_config
pDescriptorPlayback->sampleRate = (pDescriptorPlayback->sampleRate != 0) ? pDescriptorPlayback->sampleRate : MA_DEFAULT_SAMPLE_RATE; pDescriptorPlayback->sampleRate = (pDescriptorPlayback->sampleRate != 0) ? pDescriptorPlayback->sampleRate : MA_DEFAULT_SAMPLE_RATE;
if (pDescriptorPlayback->channelMap[0] == MA_CHANNEL_NONE) { if (pDescriptorPlayback->channelMap[0] == MA_CHANNEL_NONE) {
ma_get_standard_channel_map(ma_standard_channel_map_default, pDescriptorPlayback->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorPlayback->channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pDescriptorPlayback->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorPlayback->channels);
} }
pDescriptorPlayback->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); pDescriptorPlayback->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile);
...@@ -17543,7 +17543,7 @@ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context ...@@ -17543,7 +17543,7 @@ static ma_result ma_context_get_device_info_from_IAudioClient__wasapi(ma_context
channels = MA_MAX_CHANNELS; channels = MA_MAX_CHANNELS;
} }
ma_get_standard_channel_map(ma_standard_channel_map_microsoft, defaultChannelMap, ma_countof(defaultChannelMap), channels); ma_channel_map_init_standard(ma_standard_channel_map_microsoft, defaultChannelMap, ma_countof(defaultChannelMap), channels);
MA_ZERO_OBJECT(&wf); MA_ZERO_OBJECT(&wf);
wf.Format.cbSize = sizeof(wf); wf.Format.cbSize = sizeof(wf);
...@@ -22044,7 +22044,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi ...@@ -22044,7 +22044,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi
pDescriptorCapture->format = ma_format_from_WAVEFORMATEX(&wf); pDescriptorCapture->format = ma_format_from_WAVEFORMATEX(&wf);
pDescriptorCapture->channels = wf.nChannels; pDescriptorCapture->channels = wf.nChannels;
pDescriptorCapture->sampleRate = wf.nSamplesPerSec; pDescriptorCapture->sampleRate = wf.nSamplesPerSec;
ma_get_standard_channel_map(ma_standard_channel_map_microsoft, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorCapture->channels); ma_channel_map_init_standard(ma_standard_channel_map_microsoft, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorCapture->channels);
pDescriptorCapture->periodCount = pDescriptorCapture->periodCount; pDescriptorCapture->periodCount = pDescriptorCapture->periodCount;
pDescriptorCapture->periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__winmm(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile); pDescriptorCapture->periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__winmm(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile);
} }
...@@ -22082,7 +22082,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi ...@@ -22082,7 +22082,7 @@ static ma_result ma_device_init__winmm(ma_device* pDevice, const ma_device_confi
pDescriptorPlayback->format = ma_format_from_WAVEFORMATEX(&wf); pDescriptorPlayback->format = ma_format_from_WAVEFORMATEX(&wf);
pDescriptorPlayback->channels = wf.nChannels; pDescriptorPlayback->channels = wf.nChannels;
pDescriptorPlayback->sampleRate = wf.nSamplesPerSec; pDescriptorPlayback->sampleRate = wf.nSamplesPerSec;
ma_get_standard_channel_map(ma_standard_channel_map_microsoft, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap), pDescriptorPlayback->channels); ma_channel_map_init_standard(ma_standard_channel_map_microsoft, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap), pDescriptorPlayback->channels);
pDescriptorPlayback->periodCount = pDescriptorPlayback->periodCount; pDescriptorPlayback->periodCount = pDescriptorPlayback->periodCount;
pDescriptorPlayback->periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__winmm(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile); pDescriptorPlayback->periodSizeInFrames = ma_calculate_period_size_in_frames_from_descriptor__winmm(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile);
} }
...@@ -23950,7 +23950,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic ...@@ -23950,7 +23950,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic
ma_bool32 isValid = MA_TRUE; ma_bool32 isValid = MA_TRUE;
/* Fill with defaults. */ /* Fill with defaults. */
ma_get_standard_channel_map(ma_standard_channel_map_alsa, internalChannelMap, ma_countof(internalChannelMap), internalChannels); ma_channel_map_init_standard(ma_standard_channel_map_alsa, internalChannelMap, ma_countof(internalChannelMap), internalChannels);
/* Overwrite first pChmap->channels channels. */ /* Overwrite first pChmap->channels channels. */
for (iChannel = 0; iChannel < pChmap->channels; ++iChannel) { for (iChannel = 0; iChannel < pChmap->channels; ++iChannel) {
...@@ -23970,7 +23970,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic ...@@ -23970,7 +23970,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic
/* If our channel map is invalid, fall back to defaults. */ /* If our channel map is invalid, fall back to defaults. */
if (!isValid) { if (!isValid) {
ma_get_standard_channel_map(ma_standard_channel_map_alsa, internalChannelMap, ma_countof(internalChannelMap), internalChannels); ma_channel_map_init_standard(ma_standard_channel_map_alsa, internalChannelMap, ma_countof(internalChannelMap), internalChannels);
} }
} }
...@@ -23978,7 +23978,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic ...@@ -23978,7 +23978,7 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic
pChmap = NULL; pChmap = NULL;
} else { } else {
/* Could not retrieve the channel map. Fall back to a hard-coded assumption. */ /* Could not retrieve the channel map. Fall back to a hard-coded assumption. */
ma_get_standard_channel_map(ma_standard_channel_map_alsa, internalChannelMap, ma_countof(internalChannelMap), internalChannels); ma_channel_map_init_standard(ma_standard_channel_map_alsa, internalChannelMap, ma_countof(internalChannelMap), internalChannels);
} }
} }
...@@ -27300,7 +27300,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config ...@@ -27300,7 +27300,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config
pDescriptorCapture->format = ma_format_f32; pDescriptorCapture->format = ma_format_f32;
pDescriptorCapture->channels = 0; pDescriptorCapture->channels = 0;
pDescriptorCapture->sampleRate = ((ma_jack_get_sample_rate_proc)pDevice->pContext->jack.jack_get_sample_rate)((ma_jack_client_t*)pDevice->jack.pClient); pDescriptorCapture->sampleRate = ((ma_jack_get_sample_rate_proc)pDevice->pContext->jack.jack_get_sample_rate)((ma_jack_client_t*)pDevice->jack.pClient);
ma_get_standard_channel_map(ma_standard_channel_map_alsa, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorCapture->channels); ma_channel_map_init_standard(ma_standard_channel_map_alsa, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap), pDescriptorCapture->channels);
ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsOutput); ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsOutput);
if (ppPorts == NULL) { if (ppPorts == NULL) {
...@@ -27351,7 +27351,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config ...@@ -27351,7 +27351,7 @@ static ma_result ma_device_init__jack(ma_device* pDevice, const ma_device_config
pDescriptorPlayback->format = ma_format_f32; pDescriptorPlayback->format = ma_format_f32;
pDescriptorPlayback->channels = 0; pDescriptorPlayback->channels = 0;
pDescriptorPlayback->sampleRate = ((ma_jack_get_sample_rate_proc)pDevice->pContext->jack.jack_get_sample_rate)((ma_jack_client_t*)pDevice->jack.pClient); pDescriptorPlayback->sampleRate = ((ma_jack_get_sample_rate_proc)pDevice->pContext->jack.jack_get_sample_rate)((ma_jack_client_t*)pDevice->jack.pClient);
ma_get_standard_channel_map(ma_standard_channel_map_alsa, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap), pDescriptorPlayback->channels); ma_channel_map_init_standard(ma_standard_channel_map_alsa, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap), pDescriptorPlayback->channels);
ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsInput); ppPorts = ((ma_jack_get_ports_proc)pDevice->pContext->jack.jack_get_ports)((ma_jack_client_t*)pDevice->jack.pClient, NULL, MA_JACK_DEFAULT_AUDIO_TYPE, ma_JackPortIsPhysical | ma_JackPortIsInput);
if (ppPorts == NULL) { if (ppPorts == NULL) {
...@@ -27979,7 +27979,7 @@ static ma_result ma_get_channel_map_from_AudioChannelLayout(AudioChannelLayout* ...@@ -27979,7 +27979,7 @@ static ma_result ma_get_channel_map_from_AudioChannelLayout(AudioChannelLayout*
case kAudioChannelLayoutTag_Binaural: case kAudioChannelLayoutTag_Binaural:
case kAudioChannelLayoutTag_Ambisonic_B_Format: case kAudioChannelLayoutTag_Ambisonic_B_Format:
{ {
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, channelCount); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, channelCount);
} break; } break;
case kAudioChannelLayoutTag_Octagonal: case kAudioChannelLayoutTag_Octagonal:
...@@ -28007,7 +28007,7 @@ static ma_result ma_get_channel_map_from_AudioChannelLayout(AudioChannelLayout* ...@@ -28007,7 +28007,7 @@ static ma_result ma_get_channel_map_from_AudioChannelLayout(AudioChannelLayout*
default: default:
{ {
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, channelCount); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, channelCount);
} break; } break;
} }
} }
...@@ -30134,12 +30134,12 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev ...@@ -30134,12 +30134,12 @@ static ma_result ma_device_init_internal__coreaudio(ma_context* pContext, ma_dev
} }
#else #else
/* Fall back to default assumptions. */ /* Fall back to default assumptions. */
ma_get_standard_channel_map(ma_standard_channel_map_default, pData->channelMapOut, ma_countof(pData->channelMapOut), pData->channelsOut); ma_channel_map_init_standard(ma_standard_channel_map_default, pData->channelMapOut, ma_countof(pData->channelMapOut), pData->channelsOut);
#endif #endif
} }
#else #else
/* TODO: Figure out how to get the channel map using AVAudioSession. */ /* TODO: Figure out how to get the channel map using AVAudioSession. */
ma_get_standard_channel_map(ma_standard_channel_map_default, pData->channelMap, ma_countof(pData->channelMap), pData->channelsOut); ma_channel_map_init_standard(ma_standard_channel_map_default, pData->channelMap, ma_countof(pData->channelMap), pData->channelsOut);
#endif #endif
...@@ -31448,7 +31448,7 @@ static ma_result ma_device_init_handle__sndio(ma_device* pDevice, const ma_devic ...@@ -31448,7 +31448,7 @@ static ma_result ma_device_init_handle__sndio(ma_device* pDevice, const ma_devic
pDescriptor->format = internalFormat; pDescriptor->format = internalFormat;
pDescriptor->channels = internalChannels; pDescriptor->channels = internalChannels;
pDescriptor->sampleRate = internalSampleRate; pDescriptor->sampleRate = internalSampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_sndio, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), internalChannels); ma_channel_map_init_standard(ma_standard_channel_map_sndio, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), internalChannels);
pDescriptor->periodSizeInFrames = internalPeriodSizeInFrames; pDescriptor->periodSizeInFrames = internalPeriodSizeInFrames;
pDescriptor->periodCount = internalPeriods; pDescriptor->periodCount = internalPeriods;
...@@ -32292,7 +32292,7 @@ static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_c ...@@ -32292,7 +32292,7 @@ static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_c
pDescriptor->format = internalFormat; pDescriptor->format = internalFormat;
pDescriptor->channels = internalChannels; pDescriptor->channels = internalChannels;
pDescriptor->sampleRate = internalSampleRate; pDescriptor->sampleRate = internalSampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_sound4, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), internalChannels); ma_channel_map_init_standard(ma_standard_channel_map_sound4, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), internalChannels);
pDescriptor->periodSizeInFrames = internalPeriodSizeInFrames; pDescriptor->periodSizeInFrames = internalPeriodSizeInFrames;
pDescriptor->periodCount = internalPeriods; pDescriptor->periodCount = internalPeriods;
...@@ -32928,7 +32928,7 @@ static ma_result ma_device_init_fd__oss(ma_device* pDevice, const ma_device_conf ...@@ -32928,7 +32928,7 @@ static ma_result ma_device_init_fd__oss(ma_device* pDevice, const ma_device_conf
pDescriptor->format = ma_format_from_oss(ossFormat); pDescriptor->format = ma_format_from_oss(ossFormat);
pDescriptor->channels = ossChannels; pDescriptor->channels = ossChannels;
pDescriptor->sampleRate = ossSampleRate; pDescriptor->sampleRate = ossSampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_sound4, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), pDescriptor->channels); ma_channel_map_init_standard(ma_standard_channel_map_sound4, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), pDescriptor->channels);
pDescriptor->periodCount = (ma_uint32)(ossFragment >> 16); pDescriptor->periodCount = (ma_uint32)(ossFragment >> 16);
pDescriptor->periodSizeInFrames = (ma_uint32)(1 << (ossFragment & 0xFFFF)) / ma_get_bytes_per_frame(pDescriptor->format, pDescriptor->channels); pDescriptor->periodSizeInFrames = (ma_uint32)(1 << (ossFragment & 0xFFFF)) / ma_get_bytes_per_frame(pDescriptor->format, pDescriptor->channels);
...@@ -33661,9 +33661,9 @@ static ma_result ma_device_init_by_type__aaudio(ma_device* pDevice, const ma_dev ...@@ -33661,9 +33661,9 @@ static ma_result ma_device_init_by_type__aaudio(ma_device* pDevice, const ma_dev
/* For the channel map we need to be sure we don't overflow any buffers. */ /* For the channel map we need to be sure we don't overflow any buffers. */
if (pDescriptor->channels <= MA_MAX_CHANNELS) { if (pDescriptor->channels <= MA_MAX_CHANNELS) {
ma_get_standard_channel_map(ma_standard_channel_map_default, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), pDescriptor->channels); /* <-- Cannot find info on channel order, so assuming a default. */ ma_channel_map_init_standard(ma_standard_channel_map_default, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), pDescriptor->channels); /* <-- Cannot find info on channel order, so assuming a default. */
} else { } else {
ma_channel_map_init_blank(MA_MAX_CHANNELS, pDescriptor->channelMap); /* Too many channels. Use a blank channel map. */ ma_channel_map_init_blank(pDescriptor->channelMap, MA_MAX_CHANNELS); /* Too many channels. Use a blank channel map. */
} }
bufferCapacityInFrames = ((MA_PFN_AAudioStream_getBufferCapacityInFrames)pDevice->pContext->aaudio.AAudioStream_getBufferCapacityInFrames)(pStream); bufferCapacityInFrames = ((MA_PFN_AAudioStream_getBufferCapacityInFrames)pDevice->pContext->aaudio.AAudioStream_getBufferCapacityInFrames)(pStream);
...@@ -35574,7 +35574,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d ...@@ -35574,7 +35574,7 @@ static ma_result ma_device_init_by_type__webaudio(ma_device* pDevice, const ma_d
pDescriptor->format = ma_format_f32; pDescriptor->format = ma_format_f32;
pDescriptor->channels = channels; pDescriptor->channels = channels;
ma_get_standard_channel_map(ma_standard_channel_map_webaudio, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), pDescriptor->channels); ma_channel_map_init_standard(ma_standard_channel_map_webaudio, pDescriptor->channelMap, ma_countof(pDescriptor->channelMap), pDescriptor->channels);
pDescriptor->sampleRate = EM_ASM_INT({ return miniaudio.get_device_by_index($0).webaudio.sampleRate; }, deviceIndex); pDescriptor->sampleRate = EM_ASM_INT({ return miniaudio.get_device_by_index($0).webaudio.sampleRate; }, deviceIndex);
pDescriptor->periodSizeInFrames = periodSizeInFrames; pDescriptor->periodSizeInFrames = periodSizeInFrames;
pDescriptor->periodCount = 1; pDescriptor->periodCount = 1;
...@@ -35836,9 +35836,9 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d ...@@ -35836,9 +35836,9 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d
ma_channel_map_copy(pDevice->capture.channelMap, pDevice->capture.internalChannelMap, pDevice->capture.channels); ma_channel_map_copy(pDevice->capture.channelMap, pDevice->capture.internalChannelMap, pDevice->capture.channels);
} else { } else {
if (pDevice->capture.channelMixMode == ma_channel_mix_mode_simple) { if (pDevice->capture.channelMixMode == ma_channel_mix_mode_simple) {
ma_channel_map_init_blank(pDevice->capture.channels, pDevice->capture.channelMap); ma_channel_map_init_blank(pDevice->capture.channelMap, pDevice->capture.channels);
} else { } else {
ma_get_standard_channel_map(ma_standard_channel_map_default, pDevice->capture.channelMap, ma_countof(pDevice->capture.channelMap), pDevice->capture.channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pDevice->capture.channelMap, ma_countof(pDevice->capture.channelMap), pDevice->capture.channels);
} }
} }
} }
...@@ -35857,9 +35857,9 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d ...@@ -35857,9 +35857,9 @@ static ma_result ma_device__post_init_setup(ma_device* pDevice, ma_device_type d
ma_channel_map_copy(pDevice->playback.channelMap, pDevice->playback.internalChannelMap, pDevice->playback.channels); ma_channel_map_copy(pDevice->playback.channelMap, pDevice->playback.internalChannelMap, pDevice->playback.channels);
} else { } else {
if (pDevice->playback.channelMixMode == ma_channel_mix_mode_simple) { if (pDevice->playback.channelMixMode == ma_channel_mix_mode_simple) {
ma_channel_map_init_blank(pDevice->playback.channels, pDevice->playback.channelMap); ma_channel_map_init_blank(pDevice->playback.channelMap, pDevice->playback.channels);
} else { } else {
ma_get_standard_channel_map(ma_standard_channel_map_default, pDevice->playback.channelMap, ma_countof(pDevice->playback.channelMap), pDevice->playback.channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pDevice->playback.channelMap, ma_countof(pDevice->playback.channelMap), pDevice->playback.channels);
} }
} }
} }
...@@ -44952,7 +44952,7 @@ static ma_bool32 ma_is_spatial_channel_position(ma_channel channelPosition) ...@@ -44952,7 +44952,7 @@ static ma_bool32 ma_is_spatial_channel_position(ma_channel channelPosition)
static ma_bool32 ma_channel_map_is_passthrough(const ma_channel* pChannelMapIn, ma_uint32 channelsIn, const ma_channel* pChannelMapOut, ma_uint32 channelsOut) static ma_bool32 ma_channel_map_is_passthrough(const ma_channel* pChannelMapIn, ma_uint32 channelsIn, const ma_channel* pChannelMapOut, ma_uint32 channelsOut)
{ {
if (channelsOut == channelsIn) { if (channelsOut == channelsIn) {
return ma_channel_map_equal(channelsOut, pChannelMapOut, pChannelMapIn); return ma_channel_map_is_equal(pChannelMapOut, pChannelMapIn, channelsOut);
} else { } else {
return MA_FALSE; /* Channel counts differ, so cannot be a passthrough. */ return MA_FALSE; /* Channel counts differ, so cannot be a passthrough. */
} }
...@@ -47205,7 +47205,7 @@ MA_API ma_result ma_data_converter_get_input_channel_map(const ma_data_converter ...@@ -47205,7 +47205,7 @@ MA_API ma_result ma_data_converter_get_input_channel_map(const ma_data_converter
if (&pConverter->hasChannelConverter) { if (&pConverter->hasChannelConverter) {
ma_channel_converter_get_output_channel_map(&pConverter->channelConverter, pChannelMap, channelMapCap); ma_channel_converter_get_output_channel_map(&pConverter->channelConverter, pChannelMap, channelMapCap);
} else { } else {
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pConverter->channelsOut); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pConverter->channelsOut);
} }
return MA_SUCCESS; return MA_SUCCESS;
...@@ -47220,7 +47220,7 @@ MA_API ma_result ma_data_converter_get_output_channel_map(const ma_data_converte ...@@ -47220,7 +47220,7 @@ MA_API ma_result ma_data_converter_get_output_channel_map(const ma_data_converte
if (&pConverter->hasChannelConverter) { if (&pConverter->hasChannelConverter) {
ma_channel_converter_get_input_channel_map(&pConverter->channelConverter, pChannelMap, channelMapCap); ma_channel_converter_get_input_channel_map(&pConverter->channelConverter, pChannelMap, channelMapCap);
} else { } else {
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pConverter->channelsIn); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pConverter->channelsIn);
} }
return MA_SUCCESS; return MA_SUCCESS;
...@@ -47233,12 +47233,12 @@ MA_API ma_result ma_data_converter_get_output_channel_map(const ma_data_converte ...@@ -47233,12 +47233,12 @@ MA_API ma_result ma_data_converter_get_output_channel_map(const ma_data_converte
Channel Maps Channel Maps
**************************************************************************************************************************************************************/ **************************************************************************************************************************************************************/
static ma_channel ma_get_standard_channel_map_channel(ma_standard_channel_map standardChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex); static ma_channel ma_channel_map_init_standard_channel(ma_standard_channel_map standardChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex);
MA_API ma_channel ma_channel_map_get_channel(const ma_channel* pChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex) MA_API ma_channel ma_channel_map_get_channel(const ma_channel* pChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
if (pChannelMap == NULL) { if (pChannelMap == NULL) {
return ma_get_standard_channel_map_channel(ma_standard_channel_map_default, channelCount, channelIndex); return ma_channel_map_init_standard_channel(ma_standard_channel_map_default, channelCount, channelIndex);
} else { } else {
if (channelIndex >= channelCount) { if (channelIndex >= channelCount) {
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
...@@ -47248,7 +47248,7 @@ MA_API ma_channel ma_channel_map_get_channel(const ma_channel* pChannelMap, ma_u ...@@ -47248,7 +47248,7 @@ MA_API ma_channel ma_channel_map_get_channel(const ma_channel* pChannelMap, ma_u
} }
} }
MA_API void ma_channel_map_init_blank(ma_uint32 channels, ma_channel* pChannelMap) MA_API void ma_channel_map_init_blank(ma_channel* pChannelMap, ma_uint32 channels)
{ {
if (pChannelMap == NULL) { if (pChannelMap == NULL) {
return; return;
...@@ -47258,7 +47258,7 @@ MA_API void ma_channel_map_init_blank(ma_uint32 channels, ma_channel* pChannelMa ...@@ -47258,7 +47258,7 @@ MA_API void ma_channel_map_init_blank(ma_uint32 channels, ma_channel* pChannelMa
} }
static ma_channel ma_get_standard_channel_map_channel_microsoft(ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel_microsoft(ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
if (channelCount == 0 || channelIndex >= channelCount) { if (channelCount == 0 || channelIndex >= channelCount) {
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
...@@ -47372,7 +47372,7 @@ static ma_channel ma_get_standard_channel_map_channel_microsoft(ma_uint32 channe ...@@ -47372,7 +47372,7 @@ static ma_channel ma_get_standard_channel_map_channel_microsoft(ma_uint32 channe
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
} }
static ma_channel ma_get_standard_channel_map_channel_alsa(ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel_alsa(ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
switch (channelCount) switch (channelCount)
{ {
...@@ -47472,7 +47472,7 @@ static ma_channel ma_get_standard_channel_map_channel_alsa(ma_uint32 channelCoun ...@@ -47472,7 +47472,7 @@ static ma_channel ma_get_standard_channel_map_channel_alsa(ma_uint32 channelCoun
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
} }
static ma_channel ma_get_standard_channel_map_channel_rfc3551(ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel_rfc3551(ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
switch (channelCount) switch (channelCount)
{ {
...@@ -47545,7 +47545,7 @@ static ma_channel ma_get_standard_channel_map_channel_rfc3551(ma_uint32 channelC ...@@ -47545,7 +47545,7 @@ static ma_channel ma_get_standard_channel_map_channel_rfc3551(ma_uint32 channelC
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
} }
static ma_channel ma_get_standard_channel_map_channel_flac(ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel_flac(ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
switch (channelCount) switch (channelCount)
{ {
...@@ -47645,7 +47645,7 @@ static ma_channel ma_get_standard_channel_map_channel_flac(ma_uint32 channelCoun ...@@ -47645,7 +47645,7 @@ static ma_channel ma_get_standard_channel_map_channel_flac(ma_uint32 channelCoun
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
} }
static ma_channel ma_get_standard_channel_map_channel_vorbis(ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel_vorbis(ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
switch (channelCount) switch (channelCount)
{ {
...@@ -47745,7 +47745,7 @@ static ma_channel ma_get_standard_channel_map_channel_vorbis(ma_uint32 channelCo ...@@ -47745,7 +47745,7 @@ static ma_channel ma_get_standard_channel_map_channel_vorbis(ma_uint32 channelCo
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
} }
static ma_channel ma_get_standard_channel_map_channel_sound4(ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel_sound4(ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
switch (channelCount) switch (channelCount)
{ {
...@@ -47845,7 +47845,7 @@ static ma_channel ma_get_standard_channel_map_channel_sound4(ma_uint32 channelCo ...@@ -47845,7 +47845,7 @@ static ma_channel ma_get_standard_channel_map_channel_sound4(ma_uint32 channelCo
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
} }
static ma_channel ma_get_standard_channel_map_channel_sndio(ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel_sndio(ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
switch (channelCount) switch (channelCount)
{ {
...@@ -47919,7 +47919,7 @@ static ma_channel ma_get_standard_channel_map_channel_sndio(ma_uint32 channelCou ...@@ -47919,7 +47919,7 @@ static ma_channel ma_get_standard_channel_map_channel_sndio(ma_uint32 channelCou
} }
static ma_channel ma_get_standard_channel_map_channel(ma_standard_channel_map standardChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex) static ma_channel ma_channel_map_init_standard_channel(ma_standard_channel_map standardChannelMap, ma_uint32 channelCount, ma_uint32 channelIndex)
{ {
if (channelCount == 0 || channelIndex >= channelCount) { if (channelCount == 0 || channelIndex >= channelCount) {
return MA_CHANNEL_NONE; return MA_CHANNEL_NONE;
...@@ -47929,44 +47929,44 @@ static ma_channel ma_get_standard_channel_map_channel(ma_standard_channel_map st ...@@ -47929,44 +47929,44 @@ static ma_channel ma_get_standard_channel_map_channel(ma_standard_channel_map st
{ {
case ma_standard_channel_map_alsa: case ma_standard_channel_map_alsa:
{ {
return ma_get_standard_channel_map_channel_alsa(channelCount, channelIndex); return ma_channel_map_init_standard_channel_alsa(channelCount, channelIndex);
} break; } break;
case ma_standard_channel_map_rfc3551: case ma_standard_channel_map_rfc3551:
{ {
return ma_get_standard_channel_map_channel_rfc3551(channelCount, channelIndex); return ma_channel_map_init_standard_channel_rfc3551(channelCount, channelIndex);
} break; } break;
case ma_standard_channel_map_flac: case ma_standard_channel_map_flac:
{ {
return ma_get_standard_channel_map_channel_flac(channelCount, channelIndex); return ma_channel_map_init_standard_channel_flac(channelCount, channelIndex);
} break; } break;
case ma_standard_channel_map_vorbis: case ma_standard_channel_map_vorbis:
{ {
return ma_get_standard_channel_map_channel_vorbis(channelCount, channelIndex); return ma_channel_map_init_standard_channel_vorbis(channelCount, channelIndex);
} break; } break;
case ma_standard_channel_map_sound4: case ma_standard_channel_map_sound4:
{ {
return ma_get_standard_channel_map_channel_sound4(channelCount, channelIndex); return ma_channel_map_init_standard_channel_sound4(channelCount, channelIndex);
} break; } break;
case ma_standard_channel_map_sndio: case ma_standard_channel_map_sndio:
{ {
return ma_get_standard_channel_map_channel_sndio(channelCount, channelIndex); return ma_channel_map_init_standard_channel_sndio(channelCount, channelIndex);
} break; } break;
case ma_standard_channel_map_microsoft: /* Also default. */ case ma_standard_channel_map_microsoft: /* Also default. */
/*case ma_standard_channel_map_default;*/ /*case ma_standard_channel_map_default;*/
default: default:
{ {
return ma_get_standard_channel_map_channel_microsoft(channelCount, channelIndex); return ma_channel_map_init_standard_channel_microsoft(channelCount, channelIndex);
} break; } break;
} }
} }
MA_API void ma_get_standard_channel_map(ma_standard_channel_map standardChannelMap, ma_channel* pChannelMap, size_t channelMapCap, ma_uint32 channels) MA_API void ma_channel_map_init_standard(ma_standard_channel_map standardChannelMap, ma_channel* pChannelMap, size_t channelMapCap, ma_uint32 channels)
{ {
ma_uint32 iChannel; ma_uint32 iChannel;
...@@ -47979,7 +47979,7 @@ MA_API void ma_get_standard_channel_map(ma_standard_channel_map standardChannelM ...@@ -47979,7 +47979,7 @@ MA_API void ma_get_standard_channel_map(ma_standard_channel_map standardChannelM
break; /* Ran out of room. */ break; /* Ran out of room. */
} }
pChannelMap[0] = ma_get_standard_channel_map_channel(standardChannelMap, channels, iChannel); pChannelMap[0] = ma_channel_map_init_standard_channel(standardChannelMap, channels, iChannel);
pChannelMap += 1; pChannelMap += 1;
channelMapCap -= 1; channelMapCap -= 1;
} }
...@@ -48001,7 +48001,7 @@ MA_API void ma_channel_map_copy_or_default(ma_channel* pOut, size_t channelMapCa ...@@ -48001,7 +48001,7 @@ MA_API void ma_channel_map_copy_or_default(ma_channel* pOut, size_t channelMapCa
if (pIn != NULL) { if (pIn != NULL) {
ma_channel_map_copy(pOut, pIn, channels); ma_channel_map_copy(pOut, pIn, channels);
} else { } else {
ma_get_standard_channel_map(ma_standard_channel_map_default, pOut, channelMapCapOut, channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pOut, channelMapCapOut, channels);
} }
} }
...@@ -48025,7 +48025,7 @@ MA_API ma_bool32 ma_channel_map_is_valid(const ma_channel* pChannelMap, ma_uint3 ...@@ -48025,7 +48025,7 @@ MA_API ma_bool32 ma_channel_map_is_valid(const ma_channel* pChannelMap, ma_uint3
return MA_TRUE; return MA_TRUE;
} }
MA_API ma_bool32 ma_channel_map_equal(ma_uint32 channels, const ma_channel* pChannelMapA, const ma_channel* pChannelMapB) MA_API ma_bool32 ma_channel_map_is_equal(const ma_channel* pChannelMapA, const ma_channel* pChannelMapB, ma_uint32 channels)
{ {
ma_uint32 iChannel; ma_uint32 iChannel;
...@@ -48042,7 +48042,7 @@ MA_API ma_bool32 ma_channel_map_equal(ma_uint32 channels, const ma_channel* pCha ...@@ -48042,7 +48042,7 @@ MA_API ma_bool32 ma_channel_map_equal(ma_uint32 channels, const ma_channel* pCha
return MA_TRUE; return MA_TRUE;
} }
MA_API ma_bool32 ma_channel_map_blank(ma_uint32 channels, const ma_channel* pChannelMap) MA_API ma_bool32 ma_channel_map_is_blank(const ma_channel* pChannelMap, ma_uint32 channels)
{ {
ma_uint32 iChannel; ma_uint32 iChannel;
...@@ -49676,7 +49676,7 @@ static ma_result ma_audio_buffer_ref__data_source_on_get_data_format(ma_data_sou ...@@ -49676,7 +49676,7 @@ static ma_result ma_audio_buffer_ref__data_source_on_get_data_format(ma_data_sou
*pFormat = pAudioBufferRef->format; *pFormat = pAudioBufferRef->format;
*pChannels = pAudioBufferRef->channels; *pChannels = pAudioBufferRef->channels;
*pSampleRate = 0; /* There is no notion of a sample rate with audio buffers. */ *pSampleRate = 0; /* There is no notion of a sample rate with audio buffers. */
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pAudioBufferRef->channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pAudioBufferRef->channels);
return MA_SUCCESS; return MA_SUCCESS;
} }
...@@ -50366,7 +50366,7 @@ static ma_result ma_paged_audio_buffer__data_source_on_get_data_format(ma_data_s ...@@ -50366,7 +50366,7 @@ static ma_result ma_paged_audio_buffer__data_source_on_get_data_format(ma_data_s
*pFormat = pPagedAudioBuffer->pData->format; *pFormat = pPagedAudioBuffer->pData->format;
*pChannels = pPagedAudioBuffer->pData->channels; *pChannels = pPagedAudioBuffer->pData->channels;
*pSampleRate = 0; /* There is no notion of a sample rate with audio buffers. */ *pSampleRate = 0; /* There is no notion of a sample rate with audio buffers. */
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pPagedAudioBuffer->pData->channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pPagedAudioBuffer->pData->channels);
return MA_SUCCESS; return MA_SUCCESS;
} }
...@@ -53359,7 +53359,7 @@ MA_API ma_result ma_wav_get_data_format(ma_wav* pWav, ma_format* pFormat, ma_uin ...@@ -53359,7 +53359,7 @@ MA_API ma_result ma_wav_get_data_format(ma_wav* pWav, ma_format* pFormat, ma_uin
} }
if (pChannelMap != NULL) { if (pChannelMap != NULL) {
ma_get_standard_channel_map(ma_standard_channel_map_microsoft, pChannelMap, channelMapCap, pWav->dr.channels); ma_channel_map_init_standard(ma_standard_channel_map_microsoft, pChannelMap, channelMapCap, pWav->dr.channels);
} }
return MA_SUCCESS; return MA_SUCCESS;
...@@ -53997,7 +53997,7 @@ MA_API ma_result ma_flac_get_data_format(ma_flac* pFlac, ma_format* pFormat, ma_ ...@@ -53997,7 +53997,7 @@ MA_API ma_result ma_flac_get_data_format(ma_flac* pFlac, ma_format* pFormat, ma_
} }
if (pChannelMap != NULL) { if (pChannelMap != NULL) {
ma_get_standard_channel_map(ma_standard_channel_map_microsoft, pChannelMap, channelMapCap, pFlac->dr->channels); ma_channel_map_init_standard(ma_standard_channel_map_microsoft, pChannelMap, channelMapCap, pFlac->dr->channels);
} }
return MA_SUCCESS; return MA_SUCCESS;
...@@ -54625,7 +54625,7 @@ MA_API ma_result ma_mp3_get_data_format(ma_mp3* pMP3, ma_format* pFormat, ma_uin ...@@ -54625,7 +54625,7 @@ MA_API ma_result ma_mp3_get_data_format(ma_mp3* pMP3, ma_format* pFormat, ma_uin
} }
if (pChannelMap != NULL) { if (pChannelMap != NULL) {
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pMP3->dr.channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pMP3->dr.channels);
} }
return MA_SUCCESS; return MA_SUCCESS;
...@@ -55431,7 +55431,7 @@ MA_API ma_result ma_stbvorbis_get_data_format(ma_stbvorbis* pVorbis, ma_format* ...@@ -55431,7 +55431,7 @@ MA_API ma_result ma_stbvorbis_get_data_format(ma_stbvorbis* pVorbis, ma_format*
} }
if (pChannelMap != NULL) { if (pChannelMap != NULL) {
ma_get_standard_channel_map(ma_standard_channel_map_vorbis, pChannelMap, channelMapCap, pVorbis->channels); ma_channel_map_init_standard(ma_standard_channel_map_vorbis, pChannelMap, channelMapCap, pVorbis->channels);
} }
return MA_SUCCESS; return MA_SUCCESS;
...@@ -57197,7 +57197,7 @@ static ma_result ma_waveform__data_source_on_get_data_format(ma_data_source* pDa ...@@ -57197,7 +57197,7 @@ static ma_result ma_waveform__data_source_on_get_data_format(ma_data_source* pDa
*pFormat = pWaveform->config.format; *pFormat = pWaveform->config.format;
*pChannels = pWaveform->config.channels; *pChannels = pWaveform->config.channels;
*pSampleRate = pWaveform->config.sampleRate; *pSampleRate = pWaveform->config.sampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pWaveform->config.channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pWaveform->config.channels);
return MA_SUCCESS; return MA_SUCCESS;
} }
...@@ -57637,7 +57637,7 @@ static ma_result ma_noise__data_source_on_get_data_format(ma_data_source* pDataS ...@@ -57637,7 +57637,7 @@ static ma_result ma_noise__data_source_on_get_data_format(ma_data_source* pDataS
*pFormat = pNoise->config.format; *pFormat = pNoise->config.format;
*pChannels = pNoise->config.channels; *pChannels = pNoise->config.channels;
*pSampleRate = 0; /* There is no notion of sample rate with noise generation. */ *pSampleRate = 0; /* There is no notion of sample rate with noise generation. */
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pNoise->config.channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pNoise->config.channels);
return MA_SUCCESS; return MA_SUCCESS;
} }
...@@ -60594,7 +60594,7 @@ MA_API ma_result ma_resource_manager_data_buffer_get_data_format(ma_resource_man ...@@ -60594,7 +60594,7 @@ MA_API ma_result ma_resource_manager_data_buffer_get_data_format(ma_resource_man
*pFormat = pDataBuffer->pNode->data.backend.decoded.format; *pFormat = pDataBuffer->pNode->data.backend.decoded.format;
*pChannels = pDataBuffer->pNode->data.backend.decoded.channels; *pChannels = pDataBuffer->pNode->data.backend.decoded.channels;
*pSampleRate = pDataBuffer->pNode->data.backend.decoded.sampleRate; *pSampleRate = pDataBuffer->pNode->data.backend.decoded.sampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pDataBuffer->pNode->data.backend.decoded.channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pDataBuffer->pNode->data.backend.decoded.channels);
return MA_SUCCESS; return MA_SUCCESS;
}; };
...@@ -60603,7 +60603,7 @@ MA_API ma_result ma_resource_manager_data_buffer_get_data_format(ma_resource_man ...@@ -60603,7 +60603,7 @@ MA_API ma_result ma_resource_manager_data_buffer_get_data_format(ma_resource_man
*pFormat = pDataBuffer->pNode->data.backend.decodedPaged.data.format; *pFormat = pDataBuffer->pNode->data.backend.decodedPaged.data.format;
*pChannels = pDataBuffer->pNode->data.backend.decodedPaged.data.channels; *pChannels = pDataBuffer->pNode->data.backend.decodedPaged.data.channels;
*pSampleRate = pDataBuffer->pNode->data.backend.decodedPaged.sampleRate; *pSampleRate = pDataBuffer->pNode->data.backend.decodedPaged.sampleRate;
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, pDataBuffer->pNode->data.backend.decoded.channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, pDataBuffer->pNode->data.backend.decoded.channels);
return MA_SUCCESS; return MA_SUCCESS;
}; };
...@@ -66227,7 +66227,7 @@ static void ma_get_default_channel_map_for_spatializer(ma_channel* pChannelMap, ...@@ -66227,7 +66227,7 @@ static void ma_get_default_channel_map_for_spatializer(ma_channel* pChannelMap,
pChannelMap[0] = MA_CHANNEL_SIDE_LEFT; pChannelMap[0] = MA_CHANNEL_SIDE_LEFT;
pChannelMap[1] = MA_CHANNEL_SIDE_RIGHT; pChannelMap[1] = MA_CHANNEL_SIDE_RIGHT;
} else { } else {
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, channelCount); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, channelCount);
} }
} }
...@@ -69559,7 +69559,7 @@ MA_API ma_result ma_sound_get_data_format(ma_sound* pSound, ma_format* pFormat, ...@@ -69559,7 +69559,7 @@ MA_API ma_result ma_sound_get_data_format(ma_sound* pSound, ma_format* pFormat,
} }
if (pChannelMap != NULL) { if (pChannelMap != NULL) {
ma_get_standard_channel_map(ma_standard_channel_map_default, pChannelMap, channelMapCap, channels); ma_channel_map_init_standard(ma_standard_channel_map_default, pChannelMap, channelMapCap, channels);
} }
return MA_SUCCESS; return MA_SUCCESS;
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