avfilter/showwaves: split out draw sample code