lavf: simplify by using FFMAX/FFMIN.