make sure the OPUS encoder/decoder function is only called if the audio compression type is actually set to OPUS codec

This commit is contained in:
Volker Fischer 2014-07-28 17:46:54 +00:00
parent 0741b3c388
commit 26ccd51546
2 changed files with 24 additions and 12 deletions

View File

@ -1094,8 +1094,9 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
&vecCeltData[0],
iCeltNumCodedBytes );
}
else
#endif
if ( eAudioCompressionType == CT_OPUS )
{
opus_custom_encode ( OpusEncoderMono,
&vecsStereoSndCrd[i * SYSTEM_FRAME_SIZE_SAMPLES],
@ -1116,8 +1117,9 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
&vecCeltData[0],
iCeltNumCodedBytes );
}
else
#endif
if ( eAudioCompressionType == CT_OPUS )
{
opus_custom_encode ( OpusEncoderStereo,
&vecsStereoSndCrd[i * 2 * SYSTEM_FRAME_SIZE_SAMPLES],
@ -1164,8 +1166,9 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
iCeltNumCodedBytes,
&vecsAudioSndCrdMono[i * SYSTEM_FRAME_SIZE_SAMPLES] );
}
else
#endif
if ( eAudioCompressionType == CT_OPUS )
{
opus_custom_decode ( OpusDecoderMono,
&vecbyNetwData[0],
@ -1184,8 +1187,9 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
iCeltNumCodedBytes,
&vecsStereoSndCrd[i * 2 * SYSTEM_FRAME_SIZE_SAMPLES] );
}
else
#endif
if ( eAudioCompressionType == CT_OPUS )
{
opus_custom_decode ( OpusDecoderStereo,
&vecbyNetwData[0],
@ -1208,8 +1212,9 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
0,
&vecsAudioSndCrdMono[i * SYSTEM_FRAME_SIZE_SAMPLES] );
}
else
#endif
if ( eAudioCompressionType == CT_OPUS )
{
opus_custom_decode ( OpusDecoderMono,
NULL,
@ -1228,8 +1233,9 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
0,
&vecsStereoSndCrd[i * 2 * SYSTEM_FRAME_SIZE_SAMPLES] );
}
else
#endif
if ( eAudioCompressionType == CT_OPUS )
{
opus_custom_decode ( OpusDecoderStereo,
NULL,

View File

@ -759,8 +759,9 @@ void CServer::OnTimer()
iCeltNumCodedBytes,
&vecvecsData[i][0] );
}
else
#endif
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{
opus_custom_decode ( OpusDecoderMono[iCurChanID],
&vecbyCodedData[0],
@ -780,8 +781,9 @@ void CServer::OnTimer()
iCeltNumCodedBytes,
&vecvecsData[i][0] );
}
else
#endif
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{
opus_custom_decode ( OpusDecoderStereo[iCurChanID],
&vecbyCodedData[0],
@ -805,8 +807,9 @@ void CServer::OnTimer()
0,
&vecvecsData[i][0] );
}
else
#endif
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{
opus_custom_decode ( OpusDecoderMono[iCurChanID],
NULL,
@ -826,8 +829,9 @@ void CServer::OnTimer()
0,
&vecvecsData[i][0] );
}
else
#endif
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{
opus_custom_decode ( OpusDecoderStereo[iCurChanID],
NULL,
@ -888,8 +892,9 @@ void CServer::OnTimer()
&vecbyCodedData[0],
iCeltNumCodedBytes );
}
else
#endif
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{
// TODO find a better place than this: the setting does not change all the time
@ -917,8 +922,9 @@ opus_custom_encoder_ctl ( OpusEncoderMono[iCurChanID],
&vecbyCodedData[0],
iCeltNumCodedBytes );
}
else
#endif
if ( vecChannels[iCurChanID].GetAudioCompressionType() == CT_OPUS )
{
// TODO find a better place than this: the setting does not change all the time