annotate libaf/af_delay.c @ 30927:9a9d57f6d788

Use calloc instead of malloc+memset
author reimar
date Sat, 27 Mar 2010 15:35:59 +0000
parents 32725ca88fed
children 8fa2f43cb760
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28229
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
1 /*
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
2 * This audio filter delays the output signal for the different
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
3 * channels and can be used for simple position panning.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
4 * An extension for this filter would be a reverb.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
5 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
6 * This file is part of MPlayer.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
7 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
9 * it under the terms of the GNU General Public License as published by
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
11 * (at your option) any later version.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
12 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
16 * GNU General Public License for more details.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
17 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
18 * You should have received a copy of the GNU General Public License along
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
21 */
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 24888
diff changeset
22
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
23 #include <stdio.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
24 #include <stdlib.h>
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
25 #include <string.h>
8698
739ecaea201b fix compilation on solaris
attila
parents: 8675
diff changeset
26 #include <inttypes.h>
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
27
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
28 #include "af.h"
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
29
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
30 #define L 65536
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
31
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
32 #define UPDATEQI(qi) qi=(qi+1)&(L-1)
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
33
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
34 // Data for specific instances of this filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
35 typedef struct af_delay_s
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
36 {
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
37 void* q[AF_NCH]; // Circular queues used for delaying audio signal
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
38 int wi[AF_NCH]; // Write index
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
39 int ri; // Read index
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29049
diff changeset
40 float d[AF_NCH]; // Delay [ms]
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
41 }af_delay_t;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
42
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
43 // Initialization and runtime control
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
44 static int control(struct af_instance_s* af, int cmd, void* arg)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
45 {
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
46 af_delay_t* s = af->setup;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
47 switch(cmd){
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
48 case AF_CONTROL_REINIT:{
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
49 int i;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
50
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
51 // Free prevous delay queues
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
52 for(i=0;i<af->data->nch;i++){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
53 if(s->q[i])
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
54 free(s->q[i]);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
55 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
56
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
57 af->data->rate = ((af_data_t*)arg)->rate;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
58 af->data->nch = ((af_data_t*)arg)->nch;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
59 af->data->format = ((af_data_t*)arg)->format;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
60 af->data->bps = ((af_data_t*)arg)->bps;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
61
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
62 // Allocate new delay queues
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
63 for(i=0;i<af->data->nch;i++){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
64 s->q[i] = calloc(L,af->data->bps);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
65 if(NULL == s->q[i])
29049
8c706ce21c6f Remove af_msg special-casing API in libaf.
bircoph
parents: 28229
diff changeset
66 mp_msg(MSGT_AFILTER, MSGL_FATAL, "[delay] Out of memory\n");
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
67 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
68
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
69 return control(af,AF_CONTROL_DELAY_LEN | AF_CONTROL_SET,s->d);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
70 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
71 case AF_CONTROL_COMMAND_LINE:{
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
72 int n = 1;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
73 int i = 0;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
74 char* cl = arg;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
75 while(n && i < AF_NCH ){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
76 sscanf(cl,"%f:%n",&s->d[i],&n);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
77 if(n==0 || cl[n-1] == '\0')
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
78 break;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
79 cl=&cl[n];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
80 i++;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
81 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
82 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
83 }
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
84 case AF_CONTROL_DELAY_LEN | AF_CONTROL_SET:{
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
85 int i;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
86 if(AF_OK != af_from_ms(AF_NCH, arg, s->wi, af->data->rate, 0.0, 1000.0))
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
87 return AF_ERROR;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
88 s->ri = 0;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
89 for(i=0;i<AF_NCH;i++){
29049
8c706ce21c6f Remove af_msg special-casing API in libaf.
bircoph
parents: 28229
diff changeset
90 mp_msg(MSGT_AFILTER, MSGL_DBG2, "[delay] Channel %i delayed by %0.3fms\n",
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
91 i,clamp(s->d[i],0.0,1000.0));
29049
8c706ce21c6f Remove af_msg special-casing API in libaf.
bircoph
parents: 28229
diff changeset
92 mp_msg(MSGT_AFILTER, MSGL_DBG3, "[delay] Channel %i delayed by %i samples\n",
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
93 i,s->wi[i]);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
94 }
8607
d6f40a06867b Changes includes:
anders
parents: 8348
diff changeset
95 return AF_OK;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
96 }
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
97 case AF_CONTROL_DELAY_LEN | AF_CONTROL_GET:{
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
98 int i;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
99 for(i=0;i<AF_NCH;i++){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
100 if(s->ri > s->wi[i])
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
101 s->wi[i] = L - (s->ri - s->wi[i]);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
102 else
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
103 s->wi[i] = s->wi[i] - s->ri;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
104 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
105 return af_to_ms(AF_NCH, s->wi, arg, af->data->rate);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
106 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
107 }
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
108 return AF_UNKNOWN;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
109 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
110
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29049
diff changeset
111 // Deallocate memory
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
112 static void uninit(struct af_instance_s* af)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
113 {
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
114 int i;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
115 if(af->data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
116 free(af->data);
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
117 for(i=0;i<AF_NCH;i++)
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
118 if(((af_delay_t*)(af->setup))->q[i])
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
119 free(((af_delay_t*)(af->setup))->q[i]);
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
120 if(af->setup)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
121 free(af->setup);
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
122 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
123
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
124 // Filter data through filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
125 static af_data_t* play(struct af_instance_s* af, af_data_t* data)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
126 {
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
127 af_data_t* c = data; // Current working data
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
128 af_delay_t* s = af->setup; // Setup for this instance
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
129 int nch = c->nch; // Number of channels
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
130 int len = c->len/c->bps; // Number of sample in data chunk
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
131 int ri = 0;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
132 int ch,i;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
133 for(ch=0;ch<nch;ch++){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
134 switch(c->bps){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
135 case 1:{
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
136 int8_t* a = c->audio;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29049
diff changeset
137 int8_t* q = s->q[ch];
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
138 int wi = s->wi[ch];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
139 ri = s->ri;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
140 for(i=ch;i<len;i+=nch){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
141 q[wi] = a[i];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
142 a[i] = q[ri];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
143 UPDATEQI(wi);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
144 UPDATEQI(ri);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
145 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
146 s->wi[ch] = wi;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
147 break;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
148 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
149 case 2:{
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
150 int16_t* a = c->audio;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29049
diff changeset
151 int16_t* q = s->q[ch];
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
152 int wi = s->wi[ch];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
153 ri = s->ri;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
154 for(i=ch;i<len;i+=nch){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
155 q[wi] = a[i];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
156 a[i] = q[ri];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
157 UPDATEQI(wi);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
158 UPDATEQI(ri);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
159 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
160 s->wi[ch] = wi;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
161 break;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
162 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
163 case 4:{
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
164 int32_t* a = c->audio;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29049
diff changeset
165 int32_t* q = s->q[ch];
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
166 int wi = s->wi[ch];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
167 ri = s->ri;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
168 for(i=ch;i<len;i+=nch){
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
169 q[wi] = a[i];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
170 a[i] = q[ri];
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
171 UPDATEQI(wi);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
172 UPDATEQI(ri);
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
173 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
174 s->wi[ch] = wi;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
175 break;
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
176 }
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
177 }
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
178 }
8675
54c386615a70 Extending delay to have different delays for different channels
anders
parents: 8607
diff changeset
179 s->ri = ri;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
180 return c;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
181 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
182
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
183 // Allocate memory and set function pointers
22746
fd6f824ef894 Rename open to af_open so as not to conflict with a previous header definition.
diego
parents: 8698
diff changeset
184 static int af_open(af_instance_t* af){
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
185 af->control=control;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
186 af->uninit=uninit;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
187 af->play=play;
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 22746
diff changeset
188 af->mul=1;
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
189 af->data=calloc(1,sizeof(af_data_t));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
190 af->setup=calloc(1,sizeof(af_delay_t));
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
191 if(af->data == NULL || af->setup == NULL)
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
192 return AF_ERROR;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
193 return AF_OK;
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
194 }
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
195
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
196 // Description of this filter
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
197 af_info_t af_info_delay = {
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
198 "Delay audio filter",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
199 "delay",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
200 "Anders",
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
201 "",
7615
c67328dd459a Adding Support for non-reentrant audio filters
anders
parents: 7568
diff changeset
202 AF_FLAGS_REENTRANT,
22746
fd6f824ef894 Rename open to af_open so as not to conflict with a previous header definition.
diego
parents: 8698
diff changeset
203 af_open
7568
d08513b9fed6 Adding new audio output filter layer libaf
anders
parents:
diff changeset
204 };