Commit c3dd0bd8 authored by David Reid's avatar David Reid

Wire up the resampling configs for decoders.

parent 9c5461d3
...@@ -3433,6 +3433,10 @@ typedef struct ...@@ -3433,6 +3433,10 @@ typedef struct
{ {
ma_uint32 lpfCount; ma_uint32 lpfCount;
} linear; } linear;
struct
{
int quality;
} speex;
} resampling; } resampling;
} ma_decoder_config; } ma_decoder_config;
...@@ -34172,6 +34176,7 @@ ma_decoder_config ma_decoder_config_init(ma_format outputFormat, ma_uint32 outpu ...@@ -34172,6 +34176,7 @@ ma_decoder_config ma_decoder_config_init(ma_format outputFormat, ma_uint32 outpu
ma_get_standard_channel_map(ma_standard_channel_map_default, config.channels, config.channelMap); ma_get_standard_channel_map(ma_standard_channel_map_default, config.channels, config.channelMap);
config.resampling.algorithm = ma_resample_algorithm_linear; config.resampling.algorithm = ma_resample_algorithm_linear;
config.resampling.linear.lpfCount = 1; config.resampling.linear.lpfCount = 1;
config.resampling.speex.quality = 3;
return config; return config;
} }
...@@ -34227,10 +34232,12 @@ static ma_result ma_decoder__init_data_converter(ma_decoder* pDecoder, const ma_ ...@@ -34227,10 +34232,12 @@ static ma_result ma_decoder__init_data_converter(ma_decoder* pDecoder, const ma_
); );
ma_channel_map_copy(converterConfig.channelMapIn, pDecoder->internalChannelMap, pDecoder->internalChannels); ma_channel_map_copy(converterConfig.channelMapIn, pDecoder->internalChannelMap, pDecoder->internalChannels);
ma_channel_map_copy(converterConfig.channelMapOut, pDecoder->outputChannelMap, pDecoder->outputChannels); ma_channel_map_copy(converterConfig.channelMapOut, pDecoder->outputChannelMap, pDecoder->outputChannels);
converterConfig.channelMixMode = pConfig->channelMixMode; converterConfig.channelMixMode = pConfig->channelMixMode;
converterConfig.ditherMode = pConfig->ditherMode; converterConfig.ditherMode = pConfig->ditherMode;
converterConfig.resampling.algorithm = pConfig->resampling.algorithm;
converterConfig.resampling.allowDynamicSampleRate = MA_FALSE; /* Never allow dynamic sample rate conversion. Setting this to true will disable passthrough optimizations. */ converterConfig.resampling.allowDynamicSampleRate = MA_FALSE; /* Never allow dynamic sample rate conversion. Setting this to true will disable passthrough optimizations. */
converterConfig.resampling.algorithm = pConfig->resampling.algorithm;
converterConfig.resampling.linear.lpfCount = pConfig->resampling.linear.lpfCount;
converterConfig.resampling.speex.quality = pConfig->resampling.speex.quality;
return ma_data_converter_init(&converterConfig, &pDecoder->converter); return ma_data_converter_init(&converterConfig, &pDecoder->converter);
} }
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