@@ -183,6 +183,7 @@ CServer::CServer ( const int iNewMaxNumChan,
183183 vecNumFrameSizeConvBlocks.Init ( iMaxNumChannels );
184184 vecUseDoubleSysFraSizeConvBuf.Init ( iMaxNumChannels );
185185 vecAudioComprType.Init ( iMaxNumChannels );
186+ vecAudioCodingArg.Init ( iMaxNumChannels );
186187
187188 for ( i = 0 ; i < iMaxNumChannels; i++ )
188189 {
@@ -844,6 +845,7 @@ void CServer::DecodeReceiveData ( const int iChanCnt, const int iNumClients )
844845 // get and store number of audio channels and compression type
845846 vecNumAudioChannels[iChanCnt] = vecChannels[iCurChanID].GetNumAudioChannels ();
846847 vecAudioComprType[iChanCnt] = vecChannels[iCurChanID].GetAudioCompressionType ();
848+ vecAudioCodingArg[iChanCnt] = vecChannels[iCurChanID].GetAudioCodingArg ();
847849
848850 // get info about required frame size conversion properties
849851 vecUseDoubleSysFraSizeConvBuf[iChanCnt] = ( !bUseDoubleSystemFrameSize && ( vecAudioComprType[iChanCnt] == CT_OPUS ) );
@@ -974,7 +976,8 @@ void CServer::DecodeReceiveData ( const int iChanCnt, const int iNumClients )
974976 // sizeof ( int16_t ) is the size in bytes for the raw pcm audio data = 2
975977 // Sizes other than that are considered OPUS coded because those depend on hardcoded sizes in client.h
976978 const bool bIsRawAudio =
977- ( iCeltNumCodedBytes == static_cast <int > ( sizeof ( int16_t ) * iClientFrameSizeSamples * vecNumAudioChannels[iChanCnt] ) );
979+ ( vecAudioCodingArg[iChanCnt] == AQ_RAW ||
980+ iCeltNumCodedBytes == static_cast <int > ( sizeof ( int16_t ) * iClientFrameSizeSamples * vecNumAudioChannels[iChanCnt] ) );
978981
979982 const int iOffset = iB * SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[iChanCnt];
980983
@@ -1263,7 +1266,8 @@ void CServer::MixEncodeTransmitData ( const int iChanCnt, const int iNumClients
12631266 DoubleFrameSizeConvBufOut[iCurChanID].GetAll ( vecsSendData, DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES * vecNumAudioChannels[iChanCnt] );
12641267 }
12651268
1266- if ( iCeltNumCodedBytes != static_cast <int > ( sizeof ( int16_t ) * iClientFrameSizeSamples * vecNumAudioChannels[iChanCnt] ) )
1269+ if ( vecAudioCodingArg[iChanCnt] != AQ_RAW &&
1270+ iCeltNumCodedBytes != static_cast <int > ( sizeof ( int16_t ) * iClientFrameSizeSamples * vecNumAudioChannels[iChanCnt] ) )
12671271 {
12681272 // OPUS encoding
12691273 if ( CurOpusEncoder != nullptr )
0 commit comments