1From 665f68a863b4ac2e21b0a994dce7e2720c03aa9d Mon Sep 17 00:00:00 2001
2From: Fabio Berton <fabio.berton@ossystems.com.br>
3Date: Wed, 5 Oct 2016 11:02:18 -0300
4Subject: [PATCH 3/3] Fix mixer
5Organization: O.S. Systems Software LTDA.
6
7Patch from:
8https://git.backbone.ws/portage/overlay/commit/7a069112054fbb5dc94a857e9c020a38cb1c6fde
9
10Upstream-Status: Pending
11
12Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
13---
14 ctl_equal.c    | 9 ++++++---
15 ladspa_utils.c | 6 ++++--
16 pcm_equal.c    | 6 ++++--
17 3 files changed, 14 insertions(+), 7 deletions(-)
18
19diff --git a/ctl_equal.c b/ctl_equal.c
20index afba793..dd90e88 100644
21--- a/ctl_equal.c
22+++ b/ctl_equal.c
23@@ -263,7 +263,8 @@ SND_CTL_PLUGIN_DEFINE_FUNC(equal)
24 	for(i = 0; i < equal->num_input_controls; i++) {
25 		if(equal->control_data->control[i].type == LADSPA_CNTRL_INPUT) {
26 			index = equal->control_data->control[i].index;
27-			if(equal->klass->PortDescriptors[index] !=
28+			if((equal->klass->PortDescriptors[index] &
29+					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) !=
30 					(LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL)) {
31 				SNDERR("Problem with control file %s, %d.", controls, index);
32 				return -1;
33@@ -284,12 +285,14 @@ SND_CTL_PLUGIN_DEFINE_FUNC(equal)
34 	}
35
36 	/* Make sure that the control file makes sense */
37-	if(equal->klass->PortDescriptors[equal->control_data->input_index] !=
38+	if((equal->klass->PortDescriptors[equal->control_data->input_index] &
39+			(LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO))!=
40 			(LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) {
41 		SNDERR("Problem with control file %s.", controls);
42 		return -1;
43 	}
44-	if(equal->klass->PortDescriptors[equal->control_data->output_index] !=
45+	if((equal->klass->PortDescriptors[equal->control_data->output_index] &
46+			(LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO))!=
47 			(LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) {
48 		SNDERR("Problem with control file %s.", controls);
49 		return -1;
50diff --git a/ladspa_utils.c b/ladspa_utils.c
51index 7b596da..0c00800 100644
52--- a/ladspa_utils.c
53+++ b/ladspa_utils.c
54@@ -354,10 +354,12 @@ LADSPA_Control * LADSPAcontrolMMAP(const LADSPA_Descriptor *psDescriptor,
55 						default_controls->control[index].type = LADSPA_CNTRL_OUTPUT;
56 					}
57 					index++;
58-				} else if(psDescriptor->PortDescriptors[i] ==
59+				} else if((psDescriptor->PortDescriptors[i] &
60+						(LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) ==
61 						(LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) {
62 					default_controls->input_index = i;
63-				} else if(psDescriptor->PortDescriptors[i] ==
64+				} else if((psDescriptor->PortDescriptors[i] &
65+						(LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) ==
66 						(LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) {
67 					default_controls->output_index = i;
68 				}
69diff --git a/pcm_equal.c b/pcm_equal.c
70index b0b4265..8d98371 100644
71--- a/pcm_equal.c
72+++ b/pcm_equal.c
73@@ -231,12 +231,14 @@ SND_PCM_PLUGIN_DEFINE_FUNC(equal)
74 	}
75
76 	/* Make sure that the control file makes sense */
77-	if(equal->klass->PortDescriptors[equal->control_data->input_index] !=
78+	if((equal->klass->PortDescriptors[equal->control_data->input_index] &
79+			(LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) !=
80 			(LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO)) {
81 		SNDERR("Problem with control file %s.", controls);
82 		return -1;
83 	}
84-	if(equal->klass->PortDescriptors[equal->control_data->output_index] !=
85+	if((equal->klass->PortDescriptors[equal->control_data->output_index] &
86+			(LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) !=
87 			(LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO)) {
88 		SNDERR("Problem with control file %s.", controls);
89 		return -1;
90--
912.1.4
92
93