Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Jemlich <pcgod@users.sourceforge.net>2012-06-05 13:34:12 +0400
committerBenjamin Jemlich <pcgod@users.sourceforge.net>2012-06-05 13:34:12 +0400
commit852d3469c6115b081576a8e6c5f665360f060037 (patch)
tree5b07f8c5310931efe43013f492a31231a502bcf0 /src/mumble/AudioOutputSpeech.cpp
parent546b418d331167529e29647bec0f537d00ec45a3 (diff)
AudioOutputSpeech: Fix noise problems in Opus mode
Diffstat (limited to 'src/mumble/AudioOutputSpeech.cpp')
-rw-r--r--src/mumble/AudioOutputSpeech.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mumble/AudioOutputSpeech.cpp b/src/mumble/AudioOutputSpeech.cpp
index c09dabcb0..80e97f4da 100644
--- a/src/mumble/AudioOutputSpeech.cpp
+++ b/src/mumble/AudioOutputSpeech.cpp
@@ -326,8 +326,6 @@ bool AudioOutputSpeech::needSamples(unsigned int snum) {
} else if (umtType == MessageHandler::UDPVoiceOpus) {
#ifdef USE_OPUS
decodedSamples = opus_decode_float(opusState, qba.isEmpty() ? NULL : reinterpret_cast<const unsigned char *>(qba.constData()), qba.size(), pOut, iAudioBufferSize, 0);
- iOutputSize = static_cast<unsigned int>(ceilf(static_cast<float>(decodedSamples * iMixerFreq) / static_cast<float>(iSampleRate)));
- resizeBuffer(iBufferFilled + iOutputSize);
#endif
} else {
if (qba.isEmpty()) {
@@ -376,7 +374,7 @@ bool AudioOutputSpeech::needSamples(unsigned int snum) {
memset(pOut, 0, sizeof(float) * iFrameSize);
} else if (umtType == MessageHandler::UDPVoiceOpus) {
#ifdef USE_OPUS
- opus_decode_float(opusState, NULL, 0, pOut, iFrameSize, 0);
+ decodedSamples = opus_decode_float(opusState, NULL, 0, pOut, iFrameSize, 0);
#endif
} else {
speex_decode(dsSpeex, NULL, pOut);
@@ -399,7 +397,7 @@ bool AudioOutputSpeech::needSamples(unsigned int snum) {
}
nextframe:
spx_uint32_t inlen = decodedSamples;
- spx_uint32_t outlen = iOutputSize;
+ spx_uint32_t outlen = static_cast<unsigned int>(ceilf(static_cast<float>(decodedSamples * iMixerFreq) / static_cast<float>(iSampleRate)));
if (srs && bLastAlive)
speex_resampler_process_float(srs, 0, fResamplerBuffer, &inlen, pfBuffer + iBufferFilled, &outlen);
iBufferFilled += outlen;