annotate libaf/af_lavcresample.c @ 29986:31e6eb42db99

spelling cosmetics
author diego
date Mon, 14 Dec 2009 03:01:40 +0000
parents 0f1b5b68af32
children fc6f2b4e8a26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25529
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
1 /*
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
2 * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
3 *
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
4 * This file is part of MPlayer.
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
5 *
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
6 * MPlayer is free software; you can redistribute it and/or modify
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
7 * it under the terms of the GNU General Public License as published by
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
9 * (at your option) any later version.
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
10 *
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
11 * MPlayer is distributed in the hope that it will be useful,
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
14 * GNU General Public License for more details.
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
15 *
26740
b3a38b361fef Use standard license headers with standard formatting.
diego
parents: 26069
diff changeset
16 * You should have received a copy of the GNU General Public License along
b3a38b361fef Use standard license headers with standard formatting.
diego
parents: 26069
diff changeset
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b3a38b361fef Use standard license headers with standard formatting.
diego
parents: 26069
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25529
867ee1c2114b Relicense GPL v2 files as GPL v2+ and add proper license headers.
diego
parents: 24900
diff changeset
19 */
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
20
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
21 #include <stdio.h>
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
22 #include <stdlib.h>
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
23 #include <string.h>
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
24 #include <inttypes.h>
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
25
16982
a9da2db9eb16 Unify include paths by adding -I.. to CFLAGS.
diego
parents: 16168
diff changeset
26 #include "config.h"
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
27 #include "af.h"
26069
1318e956c092 FFmpeg now uses different (unified) #include paths.
diego
parents: 25529
diff changeset
28 #include "libavcodec/avcodec.h"
1318e956c092 FFmpeg now uses different (unified) #include paths.
diego
parents: 25529
diff changeset
29 #include "libavutil/rational.h"
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
30
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
31 // Data for specific instances of this filter
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
32 typedef struct af_resample_s{
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
33 struct AVResampleContext *avrctx;
22178
c4d9550c9faf Use AF_NCH for max number of channels instead of private CHANS define.
uau
parents: 17522
diff changeset
34 int16_t *in[AF_NCH];
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
35 int in_alloc;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
36 int index;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
37
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
38 int filter_length;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
39 int linear;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
40 int phase_shift;
13730
a45e901cc870 user selectable cutoff frequency
michael
parents: 13713
diff changeset
41 double cutoff;
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
42 }af_resample_t;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
43
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
44
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
45 // Initialization and runtime control
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
46 static int control(struct af_instance_s* af, int cmd, void* arg)
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
47 {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
48 af_resample_t* s = (af_resample_t*)af->setup;
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
49 af_data_t *data= (af_data_t*)arg;
14213
3c56b18bbb0c Make filters request a supported input format instead of failing.
reimar
parents: 14186
diff changeset
50 int out_rate, test_output_res; // helpers for checking input format
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
51
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
52 switch(cmd){
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
53 case AF_CONTROL_REINIT:
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
54 if((af->data->rate == data->rate) || (af->data->rate == 0))
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
55 return AF_DETACH;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
56
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
57 af->data->nch = data->nch;
22178
c4d9550c9faf Use AF_NCH for max number of channels instead of private CHANS define.
uau
parents: 17522
diff changeset
58 if (af->data->nch > AF_NCH) af->data->nch = AF_NCH;
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 14213
diff changeset
59 af->data->format = AF_FORMAT_S16_NE;
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
60 af->data->bps = 2;
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 23623
diff changeset
61 af->mul = (double)af->data->rate / data->rate;
24900
9079c9745ff9 A/V sync: take audio filter buffers into account
uau
parents: 24888
diff changeset
62 af->delay = af->data->nch * s->filter_length / min(af->mul, 1); // *bps*.5
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
63
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
64 if(s->avrctx) av_resample_close(s->avrctx);
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 23623
diff changeset
65 s->avrctx= av_resample_init(af->data->rate, /*in_rate*/data->rate, s->filter_length, s->phase_shift, s->linear, s->cutoff);
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
66
14213
3c56b18bbb0c Make filters request a supported input format instead of failing.
reimar
parents: 14186
diff changeset
67 // hack to make af_test_output ignore the samplerate change
3c56b18bbb0c Make filters request a supported input format instead of failing.
reimar
parents: 14186
diff changeset
68 out_rate = af->data->rate;
3c56b18bbb0c Make filters request a supported input format instead of failing.
reimar
parents: 14186
diff changeset
69 af->data->rate = data->rate;
3c56b18bbb0c Make filters request a supported input format instead of failing.
reimar
parents: 14186
diff changeset
70 test_output_res = af_test_output(af, (af_data_t*)arg);
3c56b18bbb0c Make filters request a supported input format instead of failing.
reimar
parents: 14186
diff changeset
71 af->data->rate = out_rate;
3c56b18bbb0c Make filters request a supported input format instead of failing.
reimar
parents: 14186
diff changeset
72 return test_output_res;
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
73 case AF_CONTROL_COMMAND_LINE:{
22755
dfe4db89562c reasonable cutoff frequency default
michael
parents: 22746
diff changeset
74 s->cutoff= 0.0;
13730
a45e901cc870 user selectable cutoff frequency
michael
parents: 13713
diff changeset
75 sscanf((char*)arg,"%d:%d:%d:%d:%lf", &af->data->rate, &s->filter_length, &s->linear, &s->phase_shift, &s->cutoff);
22755
dfe4db89562c reasonable cutoff frequency default
michael
parents: 22746
diff changeset
76 if(s->cutoff <= 0.0) s->cutoff= max(1.0 - 6.5/(s->filter_length+8), 0.80);
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
77 return AF_OK;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
78 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
79 case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET:
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
80 af->data->rate = *(int*)arg;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
81 return AF_OK;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
82 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
83 return AF_UNKNOWN;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
84 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
85
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
86 // Deallocate memory
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
87 static void uninit(struct af_instance_s* af)
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
88 {
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
89 if(af->data)
22179
ecf562795caf Fix memory leaks.
uau
parents: 22178
diff changeset
90 free(af->data->audio);
ecf562795caf Fix memory leaks.
uau
parents: 22178
diff changeset
91 free(af->data);
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
92 if(af->setup){
22182
c4fbdc3daed9 Move variable declaration to appropriate place
reimar
parents: 22181
diff changeset
93 int i;
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
94 af_resample_t *s = af->setup;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
95 if(s->avrctx) av_resample_close(s->avrctx);
22181
e99ebf35812b Cosmetics: remove tabs added in last commit from otherwise tab-free file.
reimar
parents: 22179
diff changeset
96 for (i=0; i < AF_NCH; i++)
e99ebf35812b Cosmetics: remove tabs added in last commit from otherwise tab-free file.
reimar
parents: 22179
diff changeset
97 free(s->in[i]);
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
98 free(s);
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
99 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
100 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
101
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
102 // Filter data through filter
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
103 static af_data_t* play(struct af_instance_s* af, af_data_t* data)
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
104 {
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
105 af_resample_t *s = af->setup;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
106 int i, j, consumed, ret;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
107 int16_t *in = (int16_t*)data->audio;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
108 int16_t *out;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
109 int chans = data->nch;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
110 int in_len = data->len/(2*chans);
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 23623
diff changeset
111 int out_len = in_len * af->mul + 10;
22178
c4d9550c9faf Use AF_NCH for max number of channels instead of private CHANS define.
uau
parents: 17522
diff changeset
112 int16_t tmp[AF_NCH][out_len];
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
113
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
114 if(AF_OK != RESIZE_LOCAL_BUFFER(af,data))
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
115 return NULL;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
116
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
117 out= (int16_t*)af->data->audio;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
118
13730
a45e901cc870 user selectable cutoff frequency
michael
parents: 13713
diff changeset
119 out_len= min(out_len, af->data->len/(2*chans));
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
120
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
121 if(s->in_alloc < in_len + s->index){
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
122 s->in_alloc= in_len + s->index;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
123 for(i=0; i<chans; i++){
22179
ecf562795caf Fix memory leaks.
uau
parents: 22178
diff changeset
124 s->in[i]= realloc(s->in[i], s->in_alloc*sizeof(int16_t));
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
125 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
126 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
127
14283
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
128 if(chans==1){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
129 memcpy(&s->in[0][s->index], in, in_len * sizeof(int16_t));
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
130 }else if(chans==2){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
131 for(j=0; j<in_len; j++){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
132 s->in[0][j + s->index]= *(in++);
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
133 s->in[1][j + s->index]= *(in++);
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
134 }
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
135 }else{
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
136 for(j=0; j<in_len; j++){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
137 for(i=0; i<chans; i++){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
138 s->in[i][j + s->index]= *(in++);
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
139 }
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
140 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
141 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
142 in_len += s->index;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
143
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
144 for(i=0; i<chans; i++){
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
145 ret= av_resample(s->avrctx, tmp[i], s->in[i], &consumed, in_len, out_len, i+1 == chans);
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
146 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
147 out_len= ret;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26740
diff changeset
148
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
149 s->index= in_len - consumed;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
150 for(i=0; i<chans; i++){
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
151 memmove(s->in[i], s->in[i] + consumed, s->index*sizeof(int16_t));
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
152 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
153
14283
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
154 if(chans==1){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
155 memcpy(out, tmp[0], out_len*sizeof(int16_t));
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
156 }else if(chans==2){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
157 for(j=0; j<out_len; j++){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
158 *(out++)= tmp[0][j];
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
159 *(out++)= tmp[1][j];
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
160 }
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
161 }else{
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
162 for(j=0; j<out_len; j++){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
163 for(i=0; i<chans; i++){
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
164 *(out++)= tmp[i][j];
91170dd147c6 faster packed<->planar conversation
michael
parents: 14245
diff changeset
165 }
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
166 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
167 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
168
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
169 data->audio = af->data->audio;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
170 data->len = out_len*chans*2;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
171 data->rate = af->data->rate;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
172 return data;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
173 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
174
22746
fd6f824ef894 Rename open to af_open so as not to conflict with a previous header definition.
diego
parents: 22182
diff changeset
175 static int af_open(af_instance_t* af){
14186
5053490906c3 Initialize cutoff, too. Fixes crash when AF_CONTROL_COMMAND_LINE is not set.
reimar
parents: 13859
diff changeset
176 af_resample_t *s = calloc(1,sizeof(af_resample_t));
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
177 af->control=control;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
178 af->uninit=uninit;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
179 af->play=play;
24888
b2402b4f0afa libaf: change filter input/output ratio calculations
uau
parents: 23623
diff changeset
180 af->mul=1;
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
181 af->data=calloc(1,sizeof(af_data_t));
14186
5053490906c3 Initialize cutoff, too. Fixes crash when AF_CONTROL_COMMAND_LINE is not set.
reimar
parents: 13859
diff changeset
182 s->filter_length= 16;
22755
dfe4db89562c reasonable cutoff frequency default
michael
parents: 22746
diff changeset
183 s->cutoff= max(1.0 - 6.5/(s->filter_length+8), 0.80);
14186
5053490906c3 Initialize cutoff, too. Fixes crash when AF_CONTROL_COMMAND_LINE is not set.
reimar
parents: 13859
diff changeset
184 s->phase_shift= 10;
5053490906c3 Initialize cutoff, too. Fixes crash when AF_CONTROL_COMMAND_LINE is not set.
reimar
parents: 13859
diff changeset
185 // s->setup = RSMP_INT | FREQ_SLOPPY;
5053490906c3 Initialize cutoff, too. Fixes crash when AF_CONTROL_COMMAND_LINE is not set.
reimar
parents: 13859
diff changeset
186 af->setup=s;
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
187 return AF_OK;
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
188 }
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
189
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
190 af_info_t af_info_lavcresample = {
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
191 "Sample frequency conversion using libavcodec",
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
192 "lavcresample",
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
193 "Michael Niedermayer",
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
194 "",
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
195 AF_FLAGS_REENTRANT,
22746
fd6f824ef894 Rename open to af_open so as not to conflict with a previous header definition.
diego
parents: 22182
diff changeset
196 af_open
13713
28bb0f15ac91 libavcodec resampling ...
michael
parents:
diff changeset
197 };