lavfi/movie: better memory logic for the AVFrame.