aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-06-22 17:19:42 +0200
committerMax Kellermann <max@duempel.org>2015-06-22 17:19:42 +0200
commit22f2605e2569eaa51495e23ac335bdfde217c23c (patch)
tree0596f647e1b6cd5a4c1aad4361d7fd6062594c88
parent69476b4f2193546cb72c3def9679136a182adfe3 (diff)
downloadmpd-22f2605e2569eaa51495e23ac335bdfde217c23c.tar.gz
mpd-22f2605e2569eaa51495e23ac335bdfde217c23c.tar.xz
mpd-22f2605e2569eaa51495e23ac335bdfde217c23c.zip
pcm/Interleave: convert PcmInterleave32() to template
Diffstat (limited to '')
-rw-r--r--src/pcm/Interleave.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/pcm/Interleave.cxx b/src/pcm/Interleave.cxx
index 8f8f152c5..9926b5f7f 100644
--- a/src/pcm/Interleave.cxx
+++ b/src/pcm/Interleave.cxx
@@ -36,10 +36,11 @@ GenericPcmInterleave(uint8_t *gcc_restrict dest,
}
}
-void
-PcmInterleave32(int32_t *gcc_restrict dest,
- const ConstBuffer<const int32_t *> src,
- size_t n_frames)
+template<typename T>
+static void
+PcmInterleaveT(T *gcc_restrict dest,
+ const ConstBuffer<const T *> src,
+ size_t n_frames)
{
for (const auto *s : src) {
auto *d = dest++;
@@ -51,6 +52,14 @@ PcmInterleave32(int32_t *gcc_restrict dest,
}
void
+PcmInterleave32(int32_t *gcc_restrict dest,
+ const ConstBuffer<const int32_t *> src,
+ size_t n_frames)
+{
+ PcmInterleaveT(dest, src, n_frames);
+}
+
+void
PcmInterleave(void *gcc_restrict dest,
ConstBuffer<const void *> src,
size_t n_frames, size_t sample_size)