avplay: Factorize code for adding filters to the filter pipeline