Merge pull request #10796 from birarda/bug/audio-codec-replication

check for codec changes for replicated agents
This commit is contained in:
Clément Brisset 2017-06-22 16:51:40 -07:00 committed by GitHub
commit 3ea7b82d61
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();
if (codecString != _selectedCodecName) {
qDebug() << "Manually setting codec for replicated agent" << uuidStringWithoutCurlyBraces(getNodeID()) 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 // seek back to the beginning of the message so other readers are in the right place
message->seek(0); 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