summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/synaescope/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'noatun-plugins/synaescope/core.cpp')
-rw-r--r--noatun-plugins/synaescope/core.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/noatun-plugins/synaescope/core.cpp b/noatun-plugins/synaescope/core.cpp
index e21c796..15c6730 100644
--- a/noatun-plugins/synaescope/core.cpp
+++ b/noatun-plugins/synaescope/core.cpp
@@ -24,6 +24,7 @@
#include "syna.h"
#include <unistd.h>
#include <noatun/conversion.h>
+#include <SDL_endian.h>
using namespace std;
@@ -305,9 +306,6 @@ bool Core::calculate()
double a[NumSamples], b[NumSamples];
int clarity[NumSamples]; //Surround sound
int i,j,k;
-#ifndef LITTLEENDIAN
- sampleType temp;
-#endif
int brightFactor = int(Brightness * brightnessTwiddler /(starSize+0.01));
@@ -322,18 +320,8 @@ bool Core::calculate()
for(i=0;i<NumSamples;i++)
{
-# ifdef LITTLEENDIAN
- x[i] = data[i*2];
- y[i] = data[i*2+1];
-# else
- // Need to convert to big-endian
- temp = data[i*2];
- temp = (temp >> 8) | (temp << 8);
- x[i] = temp;
- temp = data[i*2+1];
- temp = (temp << 8) | (temp >> 8);
- y[i] = temp;
-# endif
+ x[i] = SDL_SwapLE16(data[i*2]);
+ y[i] = SDL_SwapLE16(data[i*2+1]);
}
fft(x,y);