set codec mode according to client