+ /* Codec version */
+ if (msg->payload.authenticate->n_celt_versions > MAX_CODECS)
+ Log_warn("Client has more than %d CELT codecs. Ignoring %d codecs",
+ MAX_CODECS, msg->payload.authenticate->n_celt_versions - MAX_CODECS);
+
+ Log_debug("Client %d has %d CELT codecs", client->sessionId, msg->payload.authenticate->n_celt_versions);
+ if (msg->payload.authenticate->n_celt_versions > 0) {
+ int i;
+ client->codec_count = msg->payload.authenticate->n_celt_versions > MAX_CODECS ?
+ MAX_CODECS : msg->payload.authenticate->n_celt_versions;
+ for (i = 0; i < client->codec_count; i++) {
+ client->codecs[i] = msg->payload.authenticate->celt_versions[i];
+ Log_debug("Client %d CELT codec ver 0x%x", client->sessionId, client->codecs[i]);
+ }
+ } else {
+ client->codecs[0] = (int32_t)0x8000000a;
+ client->codec_count = 1;
+ }
+
+ recheckCodecVersions();
+
+ sendmsg = Msg_create(CodecVersion);
+ sendmsg->payload.codecVersion->alpha = iCodecAlpha;
+ sendmsg->payload.codecVersion->beta = iCodecBeta;
+ sendmsg->payload.codecVersion->prefer_alpha = bPreferAlpha;
+ Client_send_message(client, sendmsg);
+