Git commit e3ac7335e1647b01d4c71a571c807da60d306c80 by Harald Sitter. Committed on 31/05/2012 at 22:57. Pushed by sitter into branch 'master'. Fix analyzer drawing on non-stereo audio samples - don't draw anything if there is no sample - only use left channel on a mono sample - handle everything that is not empty or mono as stereo Should fix all possible causes of BUG: 298192 M +10 -3 src/app/analyzer/analyzerBase.cpp http://commits.kde.org/dragon/e3ac7335e1647b01d4c71a571c807da60d306c80 diff --git a/src/app/analyzer/analyzerBase.cpp b/src/app/analyzer/analyzerB= ase.cpp index 45493a7..b3179b1 100644 --- a/src/app/analyzer/analyzerBase.cpp +++ b/src/app/analyzer/analyzerBase.cpp @@ -49,14 +49,21 @@ void Analyzer::Base::transform(QVector &scope ) = //virtual = void Analyzer::Base::drawFrame(const QMap > &thescope) { + if (thescope.isEmpty()) + return; + static QVector scope( 512 ); int i =3D 0; = for( uint x =3D 0; (int)x < m_fht->size(); ++x ) { - scope[x] =3D double(thescope[Phonon::AudioDataOutput::LeftChannel][= x] - + thescope[Phonon::AudioDataOutput::RightChannel][= x]) - / (2*(1<<15)); // Average between the channels + if (thescope.size() =3D=3D 1) { // Mono + scope[x] =3D double(thescope[Phonon::AudioDataOutput::LeftChannel]= [x]); + } else { // Anything > Mono is treated as Stereo + scope[x] =3D double(thescope[Phonon::AudioDataOutput::LeftChannel]= [x] + + thescope[Phonon::AudioDataOutput::RightChannel= ][x]) + / (2*(1<<15)); // Average between the channels + } i +=3D 2; } =20