mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 08:44:04 +02:00
OpenSL: Fix compilation errors.
This commit is contained in:
+2
-16
@@ -30956,7 +30956,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf
|
|||||||
ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDescriptorCapture->format, &pDescriptorCapture->channels, &pDescriptorCapture->sampleRate, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap));
|
ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDescriptorCapture->format, &pDescriptorCapture->channels, &pDescriptorCapture->sampleRate, pDescriptorCapture->channelMap, ma_countof(pDescriptorCapture->channelMap));
|
||||||
|
|
||||||
/* Buffer. */
|
/* Buffer. */
|
||||||
pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorCapture, pDescriptorCapture->sampleRate);
|
pDescriptorCapture->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorCapture, pDescriptorCapture->sampleRate, pConfig->performanceProfile);
|
||||||
pDevice->opensl.currentBufferIndexCapture = 0;
|
pDevice->opensl.currentBufferIndexCapture = 0;
|
||||||
|
|
||||||
bufferSizeInBytes = pDescriptorCapture->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorCapture->format, pDescriptorCapture->channels) * pDescriptorCapture->periodCount;
|
bufferSizeInBytes = pDescriptorCapture->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorCapture->format, pDescriptorCapture->channels) * pDescriptorCapture->periodCount;
|
||||||
@@ -31070,21 +31070,7 @@ static ma_result ma_device_init__opensl(ma_device* pDevice, const ma_device_conf
|
|||||||
ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDescriptorPlayback->format, &pDescriptorPlayback->channels, &pDescriptorPlayback->sampleRate, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap));
|
ma_deconstruct_SLDataFormat_PCM__opensl(&pcm, &pDescriptorPlayback->format, &pDescriptorPlayback->channels, &pDescriptorPlayback->sampleRate, pDescriptorPlayback->channelMap, ma_countof(pDescriptorPlayback->channelMap));
|
||||||
|
|
||||||
/* Buffer. */
|
/* Buffer. */
|
||||||
if (pDescriptorPlayback->periodSizeInFrames == 0) {
|
pDescriptorPlayback->periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_descriptor(pDescriptorPlayback, pDescriptorPlayback->sampleRate, pConfig->performanceProfile);
|
||||||
if (pDescriptorPlayback->periodSizeInMilliseconds == 0) {
|
|
||||||
if (pConfig->performanceProfile == ma_performance_profile_low_latency) {
|
|
||||||
periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_LOW_LATENCY, pDescriptorPlayback->sampleRate);
|
|
||||||
} else {
|
|
||||||
periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE, pDescriptorPlayback->sampleRate);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
periodSizeInFrames = ma_calculate_buffer_size_in_frames_from_milliseconds(pDescriptorPlayback->periodSizeInMilliseconds, pDescriptorPlayback->sampleRate);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
periodSizeInFrames = pDescriptorPlayback->periodSizeInFrames;
|
|
||||||
}
|
|
||||||
|
|
||||||
pDescriptorPlayback->periodSizeInFrames = periodSizeInFrames;
|
|
||||||
pDevice->opensl.currentBufferIndexPlayback = 0;
|
pDevice->opensl.currentBufferIndexPlayback = 0;
|
||||||
|
|
||||||
bufferSizeInBytes = pDescriptorPlayback->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels) * pDescriptorPlayback->periodCount;
|
bufferSizeInBytes = pDescriptorPlayback->periodSizeInFrames * ma_get_bytes_per_frame(pDescriptorPlayback->format, pDescriptorPlayback->channels) * pDescriptorPlayback->periodCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user