av_init_packet does not reset data and size fields in AVPacket, avcodec_encode_audio2 can use preallocated AVPacket.