aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-03-14 23:21:20 +0100
committerMax Kellermann <max@duempel.org>2014-03-14 23:21:20 +0100
commit0d0642fd677742e1dac2fef937de03e4904a6dcb (patch)
treeec7da8dab69d6763b21ab10929a332fd6e5dded2 /src/pcm
parent08e6cf3dd2c917bcc32ea8bc3a77993b42d4fb9d (diff)
downloadmpd-0d0642fd677742e1dac2fef937de03e4904a6dcb.tar.gz
mpd-0d0642fd677742e1dac2fef937de03e4904a6dcb.tar.xz
mpd-0d0642fd677742e1dac2fef937de03e4904a6dcb.zip
pcm/PcmFormat: instantiate FloatToInteger<S32>
.. instead of reusing FloatToInteger<S24> and converting from S24 to S32 in-place.
Diffstat (limited to '')
-rw-r--r--src/pcm/PcmFormat.cxx7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/pcm/PcmFormat.cxx b/src/pcm/PcmFormat.cxx
index ca9f2e177..7c6eff790 100644
--- a/src/pcm/PcmFormat.cxx
+++ b/src/pcm/PcmFormat.cxx
@@ -263,12 +263,7 @@ pcm_allocate_24p32_to_32(PcmBuffer &buffer, ConstBuffer<int32_t> src)
static ConstBuffer<int32_t>
pcm_allocate_float_to_32(PcmBuffer &buffer, ConstBuffer<float> src)
{
- /* convert to S24_P32 first */
- auto dest = pcm_allocate_float_to_24(buffer, src);
-
- /* convert to 32 bit in-place */
- Convert24To32().Convert(dest.data, dest.data, src.size);
- return ToConst(dest);
+ return ToConst(AllocateFromFloat<SampleFormat::S32>(buffer, src));
}
ConstBuffer<int32_t>