summaryrefslogtreecommitdiff
path: root/libs/audiographer
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-03-07 23:36:05 +0100
committerRobin Gareus <robin@gareus.org>2016-03-07 23:36:05 +0100
commit8ab60f32974fbd558223cdb456daf1049716af5b (patch)
tree3583d331ecf3ef95c52f80db61e7613e0e2eeec2 /libs/audiographer
parent72ac6bc8a69762b4b7503baa160f68077ba8b20e (diff)
fix port-export analysis for > 2 channels.
Diffstat (limited to 'libs/audiographer')
-rw-r--r--libs/audiographer/src/general/analyser.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/audiographer/src/general/analyser.cc b/libs/audiographer/src/general/analyser.cc
index 1ef55ed87b..a045976403 100644
--- a/libs/audiographer/src/general/analyser.cc
+++ b/libs/audiographer/src/general/analyser.cc
@@ -162,7 +162,9 @@ Analyser::process (ProcessContext<float> const & ctx)
for (unsigned int c = 0; c < _channels; ++c) {
const float v = *d;
if (fabsf(v) > _result.peak) { _result.peak = fabsf(v); }
- _bufs[c][s] = v;
+ if (c < _result.n_channels) {
+ _bufs[c][s] = v;
+ }
const unsigned int cc = c & cmask;
if (_result.peaks[cc][pbin].min > v) { _result.peaks[cc][pbin].min = *d; }
if (_result.peaks[cc][pbin].max < v) { _result.peaks[cc][pbin].max = *d; }
@@ -173,7 +175,7 @@ Analyser::process (ProcessContext<float> const & ctx)
for (; s < _bufsize; ++s) {
_fft_data_in[s] = 0;
- for (unsigned int c = 0; c < _channels; ++c) {
+ for (unsigned int c = 0; c < _result.n_channels; ++c) {
_bufs[c][s] = 0.f;
}
}