From 28c48a8cf905daed5975fc594ae91643f28c9026 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 8 Jun 2008 08:24:38 +0000 Subject: [PATCH] VoIP: Don't lose gain for good if using VAD on disconnect. This temporarily disables VAD so the system can clean up recording state. --- code/client/cl_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 13de133a..7959bd0a 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -1155,8 +1155,12 @@ void CL_Disconnect( qboolean showMainMenu ) { #if USE_VOIP if (cl_voipSend->integer) { + int tmp = cl_voipUseVAD->integer; + cl_voipUseVAD->integer = 0; // disable this for a moment. + clc.voipOutgoingDataSize = 0; // dump any pending VoIP transmission. Cvar_Set("cl_voipSend", "0"); CL_CaptureVoip(); // clean up any state... + cl_voipUseVAD->integer = tmp; } if (clc.speexInitialized) {