always re-process codec for replicated agent

This commit is contained in:
Stephen Birarda 2017-06-22 16:18:46 -07:00
parent c47645e075
commit ec30d9ad5c
2 changed files with 9 additions and 15 deletions

View file

@ -67,13 +67,9 @@ void AudioMixerClientData::processPackets() {
case PacketType::MicrophoneAudioNoEcho: case PacketType::MicrophoneAudioNoEcho:
case PacketType::MicrophoneAudioWithEcho: case PacketType::MicrophoneAudioWithEcho:
case PacketType::InjectAudio: case PacketType::InjectAudio:
case PacketType::SilentAudioFrame: case PacketType::SilentAudioFrame: {
case PacketType::ReplicatedMicrophoneAudioNoEcho:
case PacketType::ReplicatedMicrophoneAudioWithEcho:
case PacketType::ReplicatedInjectAudio:
case PacketType::ReplicatedSilentAudioFrame: {
if (node->isUpstream() && !_hasSetupCodecForUpstreamNode) { if (node->isUpstream()) {
setupCodecForReplicatedAgent(packet); setupCodecForReplicatedAgent(packet);
} }
@ -692,14 +688,14 @@ void AudioMixerClientData::setupCodecForReplicatedAgent(QSharedPointer<ReceivedM
// pull the codec string from the packet // pull the codec string from the packet
auto codecString = message->readString(); auto codecString = message->readString();
qDebug() << "Manually setting codec for replicated agent" << uuidStringWithoutCurlyBraces(getNodeID()) if (codecString != _selectedCodecName) {
qDebug() << "Manually setting codec for replicated agent" << uuidStringWithoutCurlyBraces(getNodeID())
<< "-" << codecString; << "-" << codecString;
const std::pair<QString, CodecPluginPointer> codec = AudioMixer::negotiateCodec({ codecString }); const std::pair<QString, CodecPluginPointer> codec = AudioMixer::negotiateCodec({ codecString });
setupCodec(codec.second, codec.first); setupCodec(codec.second, codec.first);
_hasSetupCodecForUpstreamNode = true; // seek back to the beginning of the message so other readers are in the right place
message->seek(0);
// seek back to the beginning of the message so other readers are in the right place }
message->seek(0);
} }

View file

@ -184,8 +184,6 @@ private:
bool _shouldMuteClient { false }; bool _shouldMuteClient { false };
bool _requestsDomainListData { false }; bool _requestsDomainListData { false };
bool _hasSetupCodecForUpstreamNode { false };
}; };
#endif // hifi_AudioMixerClientData_h #endif // hifi_AudioMixerClientData_h