lavd/xv: simplify write_packet