aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/resample2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-10-21 21:07:40 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-10-21 21:07:40 +0000
commit6e225de2fe1d4babb7dc15f436711777c1a2b03f (patch)
treeb42ead4277aacdccdea62d0c3dc6ba26dc7e604e /libavcodec/resample2.c
parent4e255822e5119755c57c5d9498163ad3627b8ef5 (diff)
downloadffmpeg-6e225de2fe1d4babb7dc15f436711777c1a2b03f.tar.gz
user selectble cutoff frequency
Originally committed as revision 3619 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/resample2.c')
-rw-r--r--libavcodec/resample2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c
index 5fdd611539..c41f6e13a2 100644
--- a/libavcodec/resample2.c
+++ b/libavcodec/resample2.c
@@ -130,9 +130,9 @@ void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_coun
* initalizes a audio resampler.
* note, if either rate is not a integer then simply scale both rates up so they are
*/
-AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear){
+AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){
AVResampleContext *c= av_mallocz(sizeof(AVResampleContext));
- double factor= FFMIN(out_rate / (double)in_rate, 1.0);
+ double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
int phase_count= 1<<phase_shift;
memset(c, 0, sizeof(AVResampleContext));