PcmConvert: eliminate unused local variable "format"
This commit is contained in:
parent
8397196fbb
commit
052726ed50
|
@ -120,11 +120,9 @@ PcmConvert::Close()
|
||||||
ConstBuffer<void>
|
ConstBuffer<void>
|
||||||
PcmConvert::Convert(ConstBuffer<void> buffer, Error &error)
|
PcmConvert::Convert(ConstBuffer<void> buffer, Error &error)
|
||||||
{
|
{
|
||||||
AudioFormat format = src_format;
|
if (src_format.format == SampleFormat::DSD) {
|
||||||
|
|
||||||
if (format.format == SampleFormat::DSD) {
|
|
||||||
auto s = ConstBuffer<uint8_t>::FromVoid(buffer);
|
auto s = ConstBuffer<uint8_t>::FromVoid(buffer);
|
||||||
auto d = dsd.ToFloat(format.channels, s);
|
auto d = dsd.ToFloat(src_format.channels, s);
|
||||||
if (d.IsNull()) {
|
if (d.IsNull()) {
|
||||||
error.Set(pcm_domain,
|
error.Set(pcm_domain,
|
||||||
"DSD to PCM conversion failed");
|
"DSD to PCM conversion failed");
|
||||||
|
@ -132,32 +130,24 @@ PcmConvert::Convert(ConstBuffer<void> buffer, Error &error)
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = d.ToVoid();
|
buffer = d.ToVoid();
|
||||||
format.format = SampleFormat::FLOAT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable_resampler) {
|
if (enable_resampler) {
|
||||||
buffer = resampler.Resample(buffer, error);
|
buffer = resampler.Resample(buffer, error);
|
||||||
if (buffer.IsNull())
|
if (buffer.IsNull())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
format.format = resampler.GetOutputSampleFormat();
|
|
||||||
format.sample_rate = dest_format.sample_rate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable_format) {
|
if (enable_format) {
|
||||||
buffer = format_converter.Convert(buffer, error);
|
buffer = format_converter.Convert(buffer, error);
|
||||||
if (buffer.IsNull())
|
if (buffer.IsNull())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
format.format = dest_format.format;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable_channels) {
|
if (enable_channels) {
|
||||||
buffer = channels_converter.Convert(buffer, error);
|
buffer = channels_converter.Convert(buffer, error);
|
||||||
if (buffer.IsNull())
|
if (buffer.IsNull())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
format.channels = dest_format.channels;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
Loading…
Reference in New Issue