summaryrefslogtreecommitdiff
path: root/src/server/sv_main.c
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-12-10 21:14:13 -0600
committerTim Angus <tim@ngus.net>2016-04-07 11:50:43 +0100
commit975d4d97e4b9459c3d21b4dc3ecd807e9c330d9a (patch)
treeff58ec02fe6d22a097f71d1163c3527bc9abcea1 /src/server/sv_main.c
parentfae2cb94e089fabe9a69d0909a5c25e1014cb25f (diff)
Use Opus for VoIP
Server/client VoIP protocol is handled by adding new cvars cl_voipProtocol and sv_voipProtocol, sv_voip and cl_voip are used to auto set/clear them. All users need to touch are cl/sv_voip as 0 or 1 just like before. Old Speex VoIP packets in demos are skipped. New VoIP packets are skipped in demos if sv_voipProtocol doesn't match cl_voipProtocol. Notable difference between usage of speex and opus codecs, when using Speex client would be sent 80ms at a time. Using Opus, 60ms is sent at a time. This was changed because the Opus codec supports encoding up to 60ms at a time. (Simpler to send only one codec frame in a packet.)
Diffstat (limited to 'src/server/sv_main.c')
-rw-r--r--src/server/sv_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/sv_main.c b/src/server/sv_main.c
index 77d1a35d..0c4c7f46 100644
--- a/src/server/sv_main.c
+++ b/src/server/sv_main.c
@@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifdef USE_VOIP
cvar_t *sv_voip;
+cvar_t *sv_voipProtocol;
#endif
serverStatic_t svs; // persistant server info
@@ -656,8 +657,8 @@ void SVC_Info( netadr_t from ) {
Info_SetValueForKey( infostring, "pure", va("%i", sv_pure->integer ) );
#ifdef USE_VOIP
- if (sv_voip->integer) {
- Info_SetValueForKey( infostring, "voip", va("%i", sv_voip->integer ) );
+ if (sv_voipProtocol->string && *sv_voipProtocol->string) {
+ Info_SetValueForKey( infostring, "voip", sv_voipProtocol->string );
}
#endif