summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_channels.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-10 23:39:29 +0100
committerwm4 <wm4@nowhere>2013-11-12 23:34:35 +0100
commit824e6550f8ef1f361701eae469ada35d3889ab83 (patch)
tree7170184cfcdce814fde9308941fd2b4ff74d126c /audio/filter/af_channels.c
parent7510caa0c5ef3db320d1065f869d14c0eddecf79 (diff)
downloadmpv-824e6550f8ef1f361701eae469ada35d3889ab83.tar.bz2
mpv-824e6550f8ef1f361701eae469ada35d3889ab83.tar.xz
audio/filter: fix mul/delay scale and values
Before this commit, the af_instance->mul/delay values were in bytes. Using bytes is confusing for non-interleaved audio, so switch mul to samples, and delay to seconds. For delay, seconds are more intuitive than bytes or samples, because it's used for the latency calculation. We also might want to replace the delay mechanism with real PTS tracking inside the filter chain some time in the future, and PTS will also require time-adjustments to be done in seconds. For most filters, we just remove the redundant mul=1 initialization. (Setting this used to be required, but not anymore.)
Diffstat (limited to 'audio/filter/af_channels.c')
-rw-r--r--audio/filter/af_channels.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/audio/filter/af_channels.c b/audio/filter/af_channels.c
index 7e05a9e234..f77807a1af 100644
--- a/audio/filter/af_channels.c
+++ b/audio/filter/af_channels.c
@@ -168,7 +168,6 @@ static int control(struct af_instance* af, int cmd, void* arg)
af->data->rate = ((struct mp_audio*)arg)->rate;
mp_audio_set_format(af->data, ((struct mp_audio*)arg)->format);
- af->mul = (double)af->data->nch / ((struct mp_audio*)arg)->nch;
mp_audio_force_interleaved_format(af->data);
int r = af_test_output(af,(struct mp_audio*)arg);
if (r != AF_OK)
@@ -255,7 +254,6 @@ static int af_open(struct af_instance* af){
af->control=control;
af->uninit=uninit;
af->play=play;
- af->mul=1;
af->setup=calloc(1,sizeof(af_channels_t));
if(af->setup == NULL)
return AF_ERROR;