mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Fix some bugs introduced with recent changes to the resampler.
This commit is contained in:
+5
-9
@@ -33296,10 +33296,7 @@ MA_API ma_device_config ma_device_config_init(ma_device_type deviceType)
|
|||||||
ma_device_config config;
|
ma_device_config config;
|
||||||
MA_ZERO_OBJECT(&config);
|
MA_ZERO_OBJECT(&config);
|
||||||
config.deviceType = deviceType;
|
config.deviceType = deviceType;
|
||||||
|
config.resampling = ma_resampler_config_init(ma_format_unknown, 0, 0, 0, ma_resample_algorithm_linear); /* Format/channels/rate don't matter here. */
|
||||||
/* Resampling defaults. We must never use the Speex backend by default because it uses licensed third party code. */
|
|
||||||
config.resampling.algorithm = ma_resample_algorithm_linear;
|
|
||||||
config.resampling.linear.lpfOrder = ma_min(MA_DEFAULT_RESAMPLER_LPF_ORDER, MA_MAX_FILTER_ORDER);
|
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
@@ -46487,11 +46484,10 @@ MA_API ma_decoder_config ma_decoder_config_init(ma_format outputFormat, ma_uint3
|
|||||||
{
|
{
|
||||||
ma_decoder_config config;
|
ma_decoder_config config;
|
||||||
MA_ZERO_OBJECT(&config);
|
MA_ZERO_OBJECT(&config);
|
||||||
config.format = outputFormat;
|
config.format = outputFormat;
|
||||||
config.channels = ma_min(outputChannels, ma_countof(config.channelMap));
|
config.channels = ma_min(outputChannels, ma_countof(config.channelMap));
|
||||||
config.sampleRate = outputSampleRate;
|
config.sampleRate = outputSampleRate;
|
||||||
config.resampling.algorithm = ma_resample_algorithm_linear;
|
config.resampling = ma_resampler_config_init(ma_format_unknown, 0, 0, 0, ma_resample_algorithm_linear); /* Format/channels/rate doesn't matter here. */
|
||||||
config.resampling.linear.lpfOrder = ma_min(MA_DEFAULT_RESAMPLER_LPF_ORDER, MA_MAX_FILTER_ORDER);
|
|
||||||
config.encodingFormat = ma_encoding_format_unknown;
|
config.encodingFormat = ma_encoding_format_unknown;
|
||||||
|
|
||||||
/* Note that we are intentionally leaving the channel map empty here which will cause the default channel map to be used. */
|
/* Note that we are intentionally leaving the channel map empty here which will cause the default channel map to be used. */
|
||||||
|
|||||||
Reference in New Issue
Block a user