summaryrefslogtreecommitdiffstats
path: root/libaf/af_surround.c
diff options
context:
space:
mode:
authoruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-01 06:52:01 +0000
committeruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-01 06:52:01 +0000
commit7deec05ea0d14dd950715f232b9e7cb7183dd333 (patch)
treea669500520b58be3ba988f7a3e7e0b7d802e0313 /libaf/af_surround.c
parentc6824f577ee5da01a7bb0b787d0253da925c2c0f (diff)
downloadmpv-7deec05ea0d14dd950715f232b9e7cb7183dd333.tar.bz2
mpv-7deec05ea0d14dd950715f232b9e7cb7183dd333.tar.xz
libaf: change filter input/output ratio calculations
Change the audio filters to use a double instead of rationals for the ratio of output to input size. The rationals could overflow when calculating the overall ratio of a filter chain and gave no real advantage compared to doubles. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24916 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf/af_surround.c')
-rw-r--r--libaf/af_surround.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libaf/af_surround.c b/libaf/af_surround.c
index 3c56279d03..5966e725fb 100644
--- a/libaf/af_surround.c
+++ b/libaf/af_surround.c
@@ -243,7 +243,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data){
// Set output data
data->audio = af->data->audio;
- data->len = (data->len*af->mul.n)/af->mul.d;
+ data->len *= 2;
data->nch = af->data->nch;
return data;
@@ -253,8 +253,7 @@ static int af_open(af_instance_t* af){
af->control=control;
af->uninit=uninit;
af->play=play;
- af->mul.n=2;
- af->mul.d=1;
+ af->mul=2;
af->data=calloc(1,sizeof(af_data_t));
af->setup=calloc(1,sizeof(af_surround_t));
if(af->data == NULL || af->setup == NULL)