mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 00:42:57 +00:00
f46bbde5e6
When af_scaletempo2.c:process() detects a format change, it goes back through mp_scaletempo2_init() to reinitialize everything. However, mp_scaletempo2.input_buffer is not necessarily reallocated due to a check in af_scaletempo2_internals.c:resize_input_buffer(). This is a problem if the number of audio channels increases, since without reallocating, the buffer for the new channel(s) will at best point to NULL, and at worst uninitialized memory. Since resize_input_buffer() is only called from two places, pull size check out into mp_scaletempo2_fill_input_buffer(). This allows each caller to decide whether they want to resize or not. We could be smarter about when to reallocate, but that would add a lot of machinery for a case I don't expect to be hit often in practice. |
||
---|---|---|
.. | ||
af_drop.c | ||
af_format.c | ||
af_lavcac3enc.c | ||
af_rubberband.c | ||
af_scaletempo2_internals.c | ||
af_scaletempo2_internals.h | ||
af_scaletempo2.c | ||
af_scaletempo.c |