mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
Fix a bug in ma_data_converter_set_rate().
This was not setting the sample rate members of the ma_data_converter struct.
This commit is contained in:
+11
-1
@@ -65573,6 +65573,8 @@ MA_API ma_result ma_data_converter_process_pcm_frames(ma_data_converter* pConver
|
||||
|
||||
MA_API ma_result ma_data_converter_set_rate(ma_data_converter* pConverter, ma_uint32 sampleRateIn, ma_uint32 sampleRateOut)
|
||||
{
|
||||
ma_result result;
|
||||
|
||||
if (pConverter == NULL) {
|
||||
return MA_INVALID_ARGS;
|
||||
}
|
||||
@@ -65581,7 +65583,15 @@ MA_API ma_result ma_data_converter_set_rate(ma_data_converter* pConverter, ma_ui
|
||||
return MA_INVALID_OPERATION; /* Dynamic resampling not enabled. */
|
||||
}
|
||||
|
||||
return ma_resampler_set_rate(&pConverter->resampler, sampleRateIn, sampleRateOut);
|
||||
result = ma_resampler_set_rate(&pConverter->resampler, sampleRateIn, sampleRateOut);
|
||||
if (result != MA_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
pConverter->sampleRateIn = sampleRateIn;
|
||||
pConverter->sampleRateOut = sampleRateOut;
|
||||
|
||||
return MA_SUCCESS;
|
||||
}
|
||||
|
||||
MA_API ma_result ma_data_converter_set_rate_ratio(ma_data_converter* pConverter, float ratioInOut)
|
||||
|
||||
Reference in New Issue
Block a user