Fixed mac/nix build to exclude fftw and use VLC's fft instead.

This commit is contained in:
Casey Langen 2016-11-27 09:29:42 -08:00
parent 30aba00e23
commit d41f44deaf
3 changed files with 8 additions and 9 deletions

View File

@ -59,8 +59,6 @@ set (musikbox_LINK_LIBS
${linux_LINK_LIBS}
${BOOST_LINK_LIBS}
dl
fftw3
fftw3f
)
include_directories (
@ -145,4 +143,4 @@ install(
OWNER_EXECUTE OWNER_READ OWNER_WRITE
GROUP_EXECUTE GROUP_READ GROUP_WRITE
WORLD_EXECUTE WORLD_READ
)
)

View File

@ -27,6 +27,7 @@ set(CORE_SOURCES
./support/PreferenceKeys.cpp
../3rdparty/src/md5/md5.c
../3rdparty/src/sqlite/sqlite3.c
../3rdparty/src/fft.cpp
)
include_directories(

View File

@ -195,14 +195,14 @@ bool Buffer::Fft(float* buffer, int size) {
int count = this->sampleSize / FFT_BUFFER_SIZE;
/* de-interlace the audio first */
float* deinterlaced = new float[FFT_BUFFER_SIZE * count];
/* de-interleave the audio first */
float* deinterleaved = new float[FFT_BUFFER_SIZE * count];
for (int i = 0; i < count * FFT_BUFFER_SIZE; i++) {
const int to = ((i % this->channels) * FFT_BUFFER_SIZE) + (i / count);
deinterlaced[to] = this->buffer[i];
deinterleaved[to] = this->buffer[i];
}
/* if there's more than one set of interlaced data then
/* if there's more than one set of interleaved data then
allocate a scratch buffer. we'll use this for averaging
the result */
float* scratch = nullptr;
@ -216,7 +216,7 @@ bool Buffer::Fft(float* buffer, int size) {
fft_perform(this->buffer, buffer, state);
for (int i = 1; i < count; i++) {
fft_perform(&deinterlaced[i * FFT_BUFFER_SIZE], scratch, state);
fft_perform(&deinterleaved[i * FFT_BUFFER_SIZE], scratch, state);
/* average with the previous read */
for (int j = 0; j < FFT_BUFFER_SIZE; j++) {
@ -224,7 +224,7 @@ bool Buffer::Fft(float* buffer, int size) {
}
}
delete[] deinterlaced;
delete[] deinterleaved;
delete[] scratch;
fft_close(state);