lavfi/showwaves: fix floating exception with >8 channels

Signed-off-by: Paul B Mahol <onemda@gmail.com>
lavfi/trim: fix sample copy for >8 channels

Signed-off-by: Paul B Mahol <onemda@gmail.com>
lavfi/asetnsamples: unbreak for >8 channels

Signed-off-by: Paul B Mahol <onemda@gmail.com>
lavfi/ashowinfo: unbreak for >8 channels

Signed-off-by: Paul B Mahol <onemda@gmail.com>
lavfi/silencedetect: unbreak for unknown channel layouts

Signed-off-by: Paul B Mahol <onemda@gmail.com>
lavfi/aecho: fix invalid free

Signed-off-by: Paul B Mahol <onemda@gmail.com>
swscale: move format handling to its own function

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swscale: make handle_formats() safe to be called multiple times

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swscale: call handle_format() from the functions that need it

This should fix some hypothetical issues with alloc/init_context() usage

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>