diff options
author | wm4 <wm4@nowhere> | 2018-02-03 12:41:56 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-03 05:01:33 -0800 |
commit | 87d8f292f51621a5ad76bd7acebd232b5e6aefce (patch) | |
tree | 7744bd258fe51bd5c2470acfb929b358a27c2acb /filters/filter_internal.h | |
parent | 07c54d8c5ca0388cd9466438c09d380e32c13183 (diff) | |
download | mpv-87d8f292f51621a5ad76bd7acebd232b5e6aefce.tar.bz2 mpv-87d8f292f51621a5ad76bd7acebd232b5e6aefce.tar.xz |
swresample: actually reinit resampler on large speed changes
If the speed is changed by a large amount, we need to effectively change
the output rate by a large amount, and swr_set_compensation() is
apparently not designed to handle such large changes well. So it's
better to reinitialize the resampler on all large changes.
Also, strictly reinitialize the resampler if the rate changes, otherwise
it could happen that libavresample (which does not automatically
initialize resampling if avresample_set_compensation() is used) would
never apply speed changes properly.
Also document some conditions better that handle corner cases (remove
the inline condition from the if gating the compensation code).
It also appears that we crashed with very large compensation ratios
(when raising audio speed quickly by keeping the "[" key down), and this
commit accidentally mitigates it by not allowing large compensation.
Diffstat (limited to 'filters/filter_internal.h')
0 files changed, 0 insertions, 0 deletions