diff options
author | Zack Middleton <zturtleman@gmail.com> | 2014-01-14 21:04:50 -0600 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2016-04-07 11:50:43 +0100 |
commit | 8dc446735848d849c82d3e46fcce4a9b4711dd5b (patch) | |
tree | e01f5be913681ba87c5021a6f4dfb5541540787d | |
parent | 975d4d97e4b9459c3d21b4dc3ecd807e9c330d9a (diff) |
Fix some opus_decode issues
It was able to fail the assert before. I was using opus_decode wrong.
-rw-r--r-- | src/client/cl_parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 4230c04f..981d21c6 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -779,7 +779,7 @@ void CL_ParseVoip ( msg_t *msg, qboolean ignoreData ) { // tell opus that we're missing frames... for (i = 0; i < seqdiff; i++) { assert((written + VOIP_MAX_PACKET_SAMPLES) * 2 < sizeof (decoded)); - numSamples = opus_decode(clc.opusDecoder[sender], NULL, VOIP_MAX_PACKET_SAMPLES * 2, decoded + written, sizeof (decoded) - written, 0); + numSamples = opus_decode(clc.opusDecoder[sender], NULL, 0, decoded + written, VOIP_MAX_PACKET_SAMPLES, 0); if ( numSamples <= 0 ) { Com_DPrintf("VoIP: Error decoding frame %d from client #%d\n", i, sender); continue; @@ -788,7 +788,7 @@ void CL_ParseVoip ( msg_t *msg, qboolean ignoreData ) { } } - numSamples = opus_decode(clc.opusDecoder[sender], encoded, packetsize, decoded + written, sizeof (decoded) - written, 0); + numSamples = opus_decode(clc.opusDecoder[sender], encoded, packetsize, decoded + written, ARRAY_LEN(decoded) - written, 0); if ( numSamples <= 0 ) { Com_DPrintf("VoIP: Error decoding voip data from client #%d\n", sender); |