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