mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 04:42:10 +00:00
audio: remove sample rate limit checks
This played the file at a wrong sample rate if the rate was out of certain bounds. A comment says this was for the sake of libaf/af_resample.c. This resampler has been long removed. Our current resampler (libav/swresample) checks supported sample rates on reconfiguration, and will error out if a sample rate is not supported. And I think that is the correct behavior.
This commit is contained in:
parent
9be2f6b9f8
commit
ae448e198f
@ -62,14 +62,8 @@ static int build_afilter_chain(struct MPContext *mpctx)
|
||||
new_srate = in_format.rate;
|
||||
else {
|
||||
new_srate = in_format.rate * opts->playback_speed;
|
||||
if (new_srate != out_format.rate) {
|
||||
// limits are taken from libaf/af_resample.c
|
||||
if (new_srate < 8000)
|
||||
new_srate = 8000;
|
||||
if (new_srate > 192000)
|
||||
new_srate = 192000;
|
||||
if (new_srate != out_format.rate)
|
||||
opts->playback_speed = new_srate / (double)in_format.rate;
|
||||
}
|
||||
}
|
||||
return audio_init_filters(d_audio, new_srate,
|
||||
&out_format.rate, &out_format.channels, &out_format.format);
|
||||
|
Loading…
Reference in New Issue
Block a user