summaryrefslogtreecommitdiff
path: root/src/pcm
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-09-26 12:17:37 +0200
committerMax Kellermann <max@duempel.org>2014-09-26 12:17:37 +0200
commit052726ed50f1600d5ffca41291528364435ff65e (patch)
tree60e63f53fdce9903d719f2dce454bf3828e06496 /src/pcm
parent8397196fbb9d1b967bdf79205ffe965d41f73384 (diff)
PcmConvert: eliminate unused local variable "format"
Diffstat (limited to 'src/pcm')
-rw-r--r--src/pcm/PcmConvert.cxx14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/pcm/PcmConvert.cxx b/src/pcm/PcmConvert.cxx
index 13ec9ac92..bbc5fc638 100644
--- a/src/pcm/PcmConvert.cxx
+++ b/src/pcm/PcmConvert.cxx
@@ -120,11 +120,9 @@ PcmConvert::Close()
ConstBuffer<void>
PcmConvert::Convert(ConstBuffer<void> buffer, Error &error)
{
- AudioFormat format = src_format;
-
- if (format.format == SampleFormat::DSD) {
+ if (src_format.format == SampleFormat::DSD) {
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()) {
error.Set(pcm_domain,
"DSD to PCM conversion failed");
@@ -132,32 +130,24 @@ PcmConvert::Convert(ConstBuffer<void> buffer, Error &error)
}
buffer = d.ToVoid();
- format.format = SampleFormat::FLOAT;
}
if (enable_resampler) {
buffer = resampler.Resample(buffer, error);
if (buffer.IsNull())
return nullptr;
-
- format.format = resampler.GetOutputSampleFormat();
- format.sample_rate = dest_format.sample_rate;
}
if (enable_format) {
buffer = format_converter.Convert(buffer, error);
if (buffer.IsNull())
return nullptr;
-
- format.format = dest_format.format;
}
if (enable_channels) {
buffer = channels_converter.Convert(buffer, error);
if (buffer.IsNull())
return nullptr;
-
- format.channels = dest_format.channels;
}
return buffer;