Mercurial > hg > svapp
comparison audioio/AudioPulseAudioTarget.cpp @ 406:53fee450891e
Remove redundant code (sourceChannels must be at least 2 "because we offer pan") (from coverity scan)
author | Chris Cannam |
---|---|
date | Wed, 03 Sep 2014 09:23:02 +0100 |
parents | 0876ea394902 |
children | 7709bb9a1130 |
comparison
equal
deleted
inserted
replaced
405:ddfb480c70a0 | 406:53fee450891e |
---|---|
243 | 243 |
244 // PulseAudio samples are interleaved | 244 // PulseAudio samples are interleaved |
245 for (int i = 0; i < nframes; ++i) { | 245 for (int i = 0; i < nframes; ++i) { |
246 if (i < received) { | 246 if (i < received) { |
247 output[i * 2 + ch] = tmpbuf[ch][i] * m_outputGain; | 247 output[i * 2 + ch] = tmpbuf[ch][i] * m_outputGain; |
248 float sample = fabsf(output[i * 2 + ch]); | |
249 if (sample > peak) peak = sample; | |
250 } else { | |
251 output[i * 2 + ch] = 0; | |
252 } | |
253 } | |
254 | |
255 } else if (ch == 1 && sourceChannels == 1) { | |
256 | |
257 for (int i = 0; i < nframes; ++i) { | |
258 if (i < received) { | |
259 output[i * 2 + ch] = tmpbuf[0][i] * m_outputGain; | |
260 float sample = fabsf(output[i * 2 + ch]); | 248 float sample = fabsf(output[i * 2 + ch]); |
261 if (sample > peak) peak = sample; | 249 if (sample > peak) peak = sample; |
262 } else { | 250 } else { |
263 output[i * 2 + ch] = 0; | 251 output[i * 2 + ch] = 0; |
264 } | 252 } |