mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:29:01 +02:00
Fix another bug in audio-mixer audio packet parsing.
For SilentAudioFrame packets, numSamples was being read as channel flag.
This commit is contained in:
parent
ad2a031060
commit
c363a9281e
1 changed files with 12 additions and 6 deletions
|
@ -281,15 +281,21 @@ int AudioMixerClientData::parseData(ReceivedMessage& message) {
|
||||||
// pull the codec string from the packet
|
// pull the codec string from the packet
|
||||||
auto codecString = message.readString();
|
auto codecString = message.readString();
|
||||||
|
|
||||||
// read the channel flag to see if our stream is stereo or not
|
// determine if the stream is stereo or not
|
||||||
quint8 channelFlag;
|
bool isStereo;
|
||||||
message.readPrimitive(&channelFlag);
|
if (packetType == PacketType::SilentAudioFrame) {
|
||||||
|
quint16 numSilentSamples;
|
||||||
bool isStereo = channelFlag == 1;
|
message.readPrimitive(&numSilentSamples);
|
||||||
|
isStereo = numSilentSamples == AudioConstants::NETWORK_FRAME_SAMPLES_STEREO;
|
||||||
|
} else {
|
||||||
|
quint8 channelFlag;
|
||||||
|
message.readPrimitive(&channelFlag);
|
||||||
|
isStereo = channelFlag == 1;
|
||||||
|
}
|
||||||
|
|
||||||
auto avatarAudioStream = new AvatarAudioStream(isStereo, AudioMixer::getStaticJitterFrames());
|
auto avatarAudioStream = new AvatarAudioStream(isStereo, AudioMixer::getStaticJitterFrames());
|
||||||
avatarAudioStream->setupCodec(_codec, _selectedCodecName, AudioConstants::MONO);
|
avatarAudioStream->setupCodec(_codec, _selectedCodecName, AudioConstants::MONO);
|
||||||
qCDebug(audio) << "creating new AvatarAudioStream... codec:" << _selectedCodecName << "channels:" << (channelFlag + 1);
|
qCDebug(audio) << "creating new AvatarAudioStream... codec:" << _selectedCodecName << "channels:" << (isStereo ? 2 : 1);
|
||||||
|
|
||||||
connect(avatarAudioStream, &InboundAudioStream::mismatchedAudioCodec,
|
connect(avatarAudioStream, &InboundAudioStream::mismatchedAudioCodec,
|
||||||
this, &AudioMixerClientData::handleMismatchAudioFormat);
|
this, &AudioMixerClientData::handleMismatchAudioFormat);
|
||||||
|
|
Loading…
Reference in a new issue