use avcodec_free_frame() to future compatibility