diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-11-09 17:48:20 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-11-09 17:48:20 +0000 |
| commit | e0d01d34d9046c32d99868ee2a29dd8da2272ced (patch) | |
| tree | d10bfe4ab85e712747248a90ff057ae457e0d0dc /src | |
| parent | 1863bd4fc7db7246db1718d8cb0e641ac119b1b9 (diff) | |
| download | qmmp-e0d01d34d9046c32d99868ee2a29dd8da2272ced.tar.gz qmmp-e0d01d34d9046c32d99868ee2a29dd8da2272ced.tar.bz2 qmmp-e0d01d34d9046c32d99868ee2a29dd8da2272ced.zip | |
equalizer: prepare for 24-bit support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2971 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmp/equ/iir.c | 10 | ||||
| -rw-r--r-- | src/qmmp/equ/iir.h | 1 | ||||
| -rw-r--r-- | src/qmmp/output.cpp | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/qmmp/equ/iir.c b/src/qmmp/equ/iir.c index 3f946065a..8568ec9e2 100644 --- a/src/qmmp/equ/iir.c +++ b/src/qmmp/equ/iir.c @@ -40,10 +40,10 @@ unsigned int blength = 0; #endif /* - * Global vars + * Equalizer settings */ -unsigned int rate; -int band_count; +unsigned int rate = 0; +int band_count = 0; void set_preamp(int chn, float val) { @@ -58,8 +58,10 @@ void init_iir(unsigned int srate, int band_num) band_count = cfg.band_num; #endif - band_count = band_num; + if(srate == rate && band_num == band_count) + return; + band_count = band_num; rate = srate; iir_cf = get_coeffs(&band_count, rate); diff --git a/src/qmmp/equ/iir.h b/src/qmmp/equ/iir.h index 544f4c2bf..a85dfc0bf 100644 --- a/src/qmmp/equ/iir.h +++ b/src/qmmp/equ/iir.h @@ -71,7 +71,6 @@ __inline__ int round_ppc(float x); extern float preamp[EQ_CHANNELS]; extern sIIRCoefficients *iir_cf; -extern unsigned int rate; extern int band_count; #ifdef BENCHMARK diff --git a/src/qmmp/output.cpp b/src/qmmp/output.cpp index 80074e4f3..84f51610b 100644 --- a/src/qmmp/output.cpp +++ b/src/qmmp/output.cpp @@ -88,7 +88,10 @@ void Output::configure(quint32 freq, int chan, Qmmp::AudioFormat format) m_visBuffer = new unsigned char [m_visBufferSize]; m_useEq = m_eqEnabled && m_frequency && m_format == Qmmp::PCM_S16LE; if(m_frequency) + { init_iir(m_frequency, m_settings->eqSettings().bands()); + clean_history(); + } } void Output::pause() @@ -380,8 +383,7 @@ void Output::updateEqSettings() double preamp = m_settings->eqSettings().preamp(); int bands = m_settings->eqSettings().bands(); - if(band_count != bands) - init_iir(m_frequency, bands); + init_iir(m_frequency, bands); set_preamp(0, 1.0 + 0.0932471 *preamp + 0.00279033 * preamp * preamp); set_preamp(1, 1.0 + 0.0932471 *preamp + 0.00279033 * preamp * preamp); |
