From d79c1c2a19f70b24ba4fb3103fbd08c47fd7bbe9 Mon Sep 17 00:00:00 2001
From: paul-1 <6473457+paul-1@users.noreply.github.com>
Date: Wed, 16 Jan 2019 19:20:15 -0500
Subject: [PATCH 4/4] Allow LIBDIR to be set from environment

---
 Makefile    | 2 +-
 ctl_equal.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 26640e5..e524807 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ SND_CTL_OBJECTS = ctl_equal.o ladspa_utils.o
 SND_CTL_LIBS =
 SND_CTL_BIN = libasound_module_ctl_equal.so
 
-LIBDIR = lib
+LIBDIR ?= lib
 
 .PHONY: all clean dep load_default
 
diff --git a/ctl_equal.c b/ctl_equal.c
index 918fa5a..30b0ed1 100644
--- a/ctl_equal.c
+++ b/ctl_equal.c
@@ -263,8 +263,8 @@ SND_CTL_PLUGIN_DEFINE_FUNC(equal)
 	for(i = 0; i < equal->num_input_controls; i++) {
 		if(equal->control_data->control[i].type == LADSPA_CNTRL_INPUT) {
 			index = equal->control_data->control[i].index;
-			if(equal->klass->PortDescriptors[index] !=
-					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) {
+			if((equal->klass->PortDescriptors[index] &
+					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) == 0) {
 				SNDERR("Problem with control file %s, %d.", controls, index);
 				return -1;
 			}
-- 
2.19.2

