(sndfile loader) Removed useless allocation when mixing to mono

Former-commit-id: 22a4032bd2edffe51b9d9d823d7a2155a7b9fef5
This commit is contained in:
Lynix
2015-02-08 14:35:27 +01:00
parent 28bbc28125
commit 0a9bf851fd
2 changed files with 3 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
template<typename T>
void NzMixToMono(T* input, T* output, unsigned int channelCount, unsigned int frameCount)
{
///DOC: Le buffer d'entrée peut être le même que le buffer de sortie
// Pour éviter l'overflow, on utilise comme accumulateur un type assez grand, (u)int 64 bits pour les entiers, double pour les flottants
typedef typename std::conditional<std::is_unsigned<T>::value, nzUInt64, nzInt64>::type BiggestInt;
typedef typename std::conditional<std::is_integral<T>::value, BiggestInt, double>::type Biggest;