summaryrefslogtreecommitdiffstats
path: root/audio/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-05 20:49:24 +0200
committerwm4 <wm4@nowhere>2014-09-05 20:49:35 +0200
commitce246296b3fe899ec370ee60f91219fb74cf4273 (patch)
treee9dd5d045d8c7cc6d62983cd1156d2a65c866dba /audio/filter
parent5f29073abfd78faa7fb7d38df95e3064a7e2cca2 (diff)
downloadmpv-ce246296b3fe899ec370ee60f91219fb74cf4273.tar.bz2
mpv-ce246296b3fe899ec370ee60f91219fb74cf4273.tar.xz
af_hrtf: request required samplerate, instead of erroring out
It seems hrtf works in 48khz only - and if that wasn't the input, the filter just exited with an error. Make it request the 48khz instead. The player will insert a resampling filter. Not sure why it wasn't done like this in the first place.
Diffstat (limited to 'audio/filter')
-rw-r--r--audio/filter/af_hrtf.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/audio/filter/af_hrtf.c b/audio/filter/af_hrtf.c
index 19605453e7..9ffda62448 100644
--- a/audio/filter/af_hrtf.c
+++ b/audio/filter/af_hrtf.c
@@ -292,14 +292,7 @@ static int control(struct af_instance *af, int cmd, void* arg)
switch(cmd) {
case AF_CONTROL_REINIT:
- af->data->rate = ((struct mp_audio*)arg)->rate;
- if(af->data->rate != 48000) {
- // automatic samplerate adjustment in the filter chain
- // is not yet supported.
- MP_ERR(af, "ERROR: Sampling rate is not 48000 Hz (%d)!\n",
- af->data->rate);
- return AF_ERROR;
- }
+ af->data->rate = 48000;
mp_audio_set_channels_old(af->data, ((struct mp_audio*)arg)->nch);
if(af->data->nch == 2) {
/* 2 channel input */