Require at least three frames to autodetect loas.
ffmpeg: free attachments, fix memleak

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