pcm/PcmConvert: remove unused attribute "dest_format"
This commit is contained in:
src/pcm
@ -30,8 +30,8 @@ pcm_convert_global_init(const ConfigData &config)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PcmConvert::PcmConvert(const AudioFormat _src_format,
|
PcmConvert::PcmConvert(const AudioFormat _src_format,
|
||||||
const AudioFormat _dest_format)
|
const AudioFormat dest_format)
|
||||||
:src_format(_src_format), dest_format(_dest_format)
|
:src_format(_src_format)
|
||||||
{
|
{
|
||||||
assert(src_format.IsValid());
|
assert(src_format.IsValid());
|
||||||
assert(dest_format.IsValid());
|
assert(dest_format.IsValid());
|
||||||
@ -40,19 +40,19 @@ PcmConvert::PcmConvert(const AudioFormat _src_format,
|
|||||||
if (format.format == SampleFormat::DSD)
|
if (format.format == SampleFormat::DSD)
|
||||||
format.format = SampleFormat::FLOAT;
|
format.format = SampleFormat::FLOAT;
|
||||||
|
|
||||||
enable_resampler = format.sample_rate != _dest_format.sample_rate;
|
enable_resampler = format.sample_rate != dest_format.sample_rate;
|
||||||
if (enable_resampler) {
|
if (enable_resampler) {
|
||||||
resampler.Open(format, _dest_format.sample_rate);
|
resampler.Open(format, dest_format.sample_rate);
|
||||||
|
|
||||||
format.format = resampler.GetOutputSampleFormat();
|
format.format = resampler.GetOutputSampleFormat();
|
||||||
format.sample_rate = _dest_format.sample_rate;
|
format.sample_rate = dest_format.sample_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_format = format.format != _dest_format.format;
|
enable_format = format.format != dest_format.format;
|
||||||
if (enable_format) {
|
if (enable_format) {
|
||||||
try {
|
try {
|
||||||
format_converter.Open(format.format,
|
format_converter.Open(format.format,
|
||||||
_dest_format.format);
|
dest_format.format);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
if (enable_resampler)
|
if (enable_resampler)
|
||||||
resampler.Close();
|
resampler.Close();
|
||||||
@ -60,13 +60,13 @@ PcmConvert::PcmConvert(const AudioFormat _src_format,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
format.format = _dest_format.format;
|
format.format = dest_format.format;
|
||||||
|
|
||||||
enable_channels = format.channels != _dest_format.channels;
|
enable_channels = format.channels != dest_format.channels;
|
||||||
if (enable_channels) {
|
if (enable_channels) {
|
||||||
try {
|
try {
|
||||||
channels_converter.Open(format.format, format.channels,
|
channels_converter.Open(format.format, format.channels,
|
||||||
_dest_format.channels);
|
dest_format.channels);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
if (enable_format)
|
if (enable_format)
|
||||||
format_converter.Close();
|
format_converter.Close();
|
||||||
|
@ -47,7 +47,7 @@ class PcmConvert {
|
|||||||
PcmFormatConverter format_converter;
|
PcmFormatConverter format_converter;
|
||||||
PcmChannelsConverter channels_converter;
|
PcmChannelsConverter channels_converter;
|
||||||
|
|
||||||
const AudioFormat src_format, dest_format;
|
const AudioFormat src_format;
|
||||||
|
|
||||||
bool enable_resampler, enable_format, enable_channels;
|
bool enable_resampler, enable_format, enable_channels;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user