Makefile.am | 2 +- configure.ac | 15 +++++++++++++++ src/pulsecore/filter/biquad.c | 24 ++++++++++++------------ 3 files changed, 28 insertions(+), 13 deletions(-)
New commits: commit 84dff820ed14f8a4d95f4dd230a02f33c0d6a1ea Author: Ville Skyttä <[email protected]> Date: Sun Jan 25 13:38:43 2015 +0200 build-sys: Install bash completion to where bash-completion.pc says Fall back to the previous /etc/bash_completion.d dir on failures (either old bash completion or not installed). changes over Ville Skyttä's patch: define PKG_CHECK_VAR macro which became available only in pkg-config 0.28 see https://bugs.freedesktop.org/show_bug.cgi?id=88782 and https://bugs.freedesktop.org/show_bug.cgi?id=89540 Signed-off-by: Ville Skyttä <[email protected]> Signed-off-by: Peter Meerwald <[email protected]> diff --git a/Makefile.am b/Makefile.am index 75b784f..b39fc41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,7 +59,7 @@ endif cmakedir = $(libdir)/cmake/PulseAudio cmake_DATA = PulseAudioConfig.cmake PulseAudioConfigVersion.cmake -bashcompletiondir=$(sysconfdir)/bash_completion.d +bashcompletiondir=@bashcompletiondir@ dist_bashcompletion_DATA = shell-completion/bash/pulseaudio install-bashcompletion-aliases: diff --git a/configure.ac b/configure.ac index b2fcd1e..9e65684 100644 --- a/configure.ac +++ b/configure.ac @@ -1436,6 +1436,20 @@ AC_ARG_WITH( AC_SUBST(udevrulesdir) +# PKG_CHECK_VAR available with pkg-config 0.28 +AC_DEFUN([PKG_CHECK_VAR], + [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl + AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + _PKG_CONFIG([$1], [variable="][$3]["], [$2]) + AS_VAR_COPY([$1], [pkg_cv_][$1]) + AS_VAR_IF([$1], [""], [$5], [$4])dnl + ]) + +PKG_CHECK_VAR(bashcompletiondir, [bash-completion], [completionsdir], , + bashcompletiondir="${sysconfdir}/bash_completion.d") + +AC_SUBST(bashcompletiondir) + AC_ARG_WITH( [zsh-completion-dir], AS_HELP_STRING([--with-zsh-completion-dir], [Zsh completions directory (defaults to ${datadir}/zsh/site-functions)]), @@ -1563,6 +1577,7 @@ echo " System State Path: ${PA_SYSTEM_STATE_PATH} System Config Path: ${PA_SYSTEM_CONFIG_PATH} Zsh completions directory: ${zshcompletiondir} + Bash completions directory: ${bashcompletiondir} Compiler: ${CC} CFLAGS: ${CFLAGS} CPPFLAGS: ${CPPFLAGS} commit a26defed9ee4f4f9e8db79bd9051231d74717598 Author: Peter Meerwald <[email protected]> Date: Wed May 20 17:02:13 2015 +0200 biquad: Fix warning, gamma shadows global declaration pulsecore/filter/biquad.c: In function 'biquad_lowpass': pulsecore/filter/biquad.c:52:10: warning: declaration of 'gamma' shadows a global declaration [-Wshadow] pulsecore/filter/biquad.c: In function 'biquad_highpass': pulsecore/filter/biquad.c:86:10: warning: declaration of 'gamma' shadows a global declaration [-Wshadow] Signed-off-by: Peter Meerwald <[email protected]> diff --git a/src/pulsecore/filter/biquad.c b/src/pulsecore/filter/biquad.c index 4d14864..3205e7c 100644 --- a/src/pulsecore/filter/biquad.c +++ b/src/pulsecore/filter/biquad.c @@ -51,13 +51,13 @@ static void biquad_lowpass(struct biquad *bq, double cutoff) double theta = M_PI * cutoff; double sn = 0.5 * M_SQRT2 * sin(theta); double beta = 0.5 * (1 - sn) / (1 + sn); - double gamma = (0.5 + beta) * cos(theta); - double alpha = 0.25 * (0.5 + beta - gamma); + double gamma_coeff = (0.5 + beta) * cos(theta); + double alpha = 0.25 * (0.5 + beta - gamma_coeff); double b0 = 2 * alpha; double b1 = 2 * 2 * alpha; double b2 = 2 * alpha; - double a1 = 2 * -gamma; + double a1 = 2 * -gamma_coeff; double a2 = 2 * beta; set_coefficient(bq, b0, b1, b2, 1, a1, a2); @@ -83,13 +83,13 @@ static void biquad_highpass(struct biquad *bq, double cutoff) double theta = M_PI * cutoff; double sn = 0.5 * M_SQRT2 * sin(theta); double beta = 0.5 * (1 - sn) / (1 + sn); - double gamma = (0.5 + beta) * cos(theta); - double alpha = 0.25 * (0.5 + beta + gamma); + double gamma_coeff = (0.5 + beta) * cos(theta); + double alpha = 0.25 * (0.5 + beta + gamma_coeff); double b0 = 2 * alpha; double b1 = 2 * -2 * alpha; double b2 = 2 * alpha; - double a1 = 2 * -gamma; + double a1 = 2 * -gamma_coeff; double a2 = 2 * beta; set_coefficient(bq, b0, b1, b2, 1, a1, a2); commit 815c67f8d7dff53a6b01452ba4f485cef5744cda Author: Peter Meerwald <[email protected]> Date: Wed May 20 16:55:31 2015 +0200 biquad: Make use of M_SQRT2 constant should be in math.h, use it Signed-off-by: Peter Meerwald <[email protected]> diff --git a/src/pulsecore/filter/biquad.c b/src/pulsecore/filter/biquad.c index 7c21a29..4d14864 100644 --- a/src/pulsecore/filter/biquad.c +++ b/src/pulsecore/filter/biquad.c @@ -22,6 +22,10 @@ #define M_PI 3.14159265358979323846 #endif +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 +#endif + static void set_coefficient(struct biquad *bq, double b0, double b1, double b2, double a0, double a1, double a2) { @@ -44,10 +48,8 @@ static void biquad_lowpass(struct biquad *bq, double cutoff) set_coefficient(bq, 1, 0, 0, 1, 0, 0); } else if (cutoff > 0) { /* Compute biquad coefficients for lowpass filter */ - double d = sqrt(2); - double theta = M_PI * cutoff; - double sn = 0.5 * d * sin(theta); + double sn = 0.5 * M_SQRT2 * sin(theta); double beta = 0.5 * (1 - sn) / (1 + sn); double gamma = (0.5 + beta) * cos(theta); double alpha = 0.25 * (0.5 + beta - gamma); @@ -78,10 +80,8 @@ static void biquad_highpass(struct biquad *bq, double cutoff) set_coefficient(bq, 0, 0, 0, 1, 0, 0); } else if (cutoff > 0) { /* Compute biquad coefficients for highpass filter */ - double d = sqrt(2); - double theta = M_PI * cutoff; - double sn = 0.5 * d * sin(theta); + double sn = 0.5 * M_SQRT2 * sin(theta); double beta = 0.5 * (1 - sn) / (1 + sn); double gamma = (0.5 + beta) * cos(theta); double alpha = 0.25 * (0.5 + beta + gamma);
_______________________________________________ pulseaudio-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/pulseaudio-commits
