mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
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.
This commit is contained in:
parent
5f29073abf
commit
ce246296b3
@ -292,14 +292,7 @@ static int control(struct af_instance *af, int cmd, void* arg)
|
|||||||
|
|
||||||
switch(cmd) {
|
switch(cmd) {
|
||||||
case AF_CONTROL_REINIT:
|
case AF_CONTROL_REINIT:
|
||||||
af->data->rate = ((struct mp_audio*)arg)->rate;
|
af->data->rate = 48000;
|
||||||
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;
|
|
||||||
}
|
|
||||||
mp_audio_set_channels_old(af->data, ((struct mp_audio*)arg)->nch);
|
mp_audio_set_channels_old(af->data, ((struct mp_audio*)arg)->nch);
|
||||||
if(af->data->nch == 2) {
|
if(af->data->nch == 2) {
|
||||||
/* 2 channel input */
|
/* 2 channel input */
|
||||||
|
Loading…
Reference in New Issue
Block a user