mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 08:06:11 +02:00
cleanup
This commit is contained in:
parent
dbf60a594c
commit
c484fec51d
2 changed files with 3 additions and 7 deletions
|
@ -116,8 +116,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
|
||||||
|
|
||||||
// parse the info after the seq number and before the audio data (the stream properties)
|
// parse the info after the seq number and before the audio data (the stream properties)
|
||||||
int prePropertyPosition = message.getPosition();
|
int prePropertyPosition = message.getPosition();
|
||||||
auto afterHeader = message.readWithoutCopy(message.getBytesLeftToRead());
|
int propertyBytes = parseStreamProperties(message.getType(), message.readWithoutCopy(message.getBytesLeftToRead()), networkSamples);
|
||||||
int propertyBytes = parseStreamProperties(message.getType(), afterHeader, networkSamples);
|
|
||||||
message.seek(prePropertyPosition + propertyBytes);
|
message.seek(prePropertyPosition + propertyBytes);
|
||||||
|
|
||||||
// handle this packet based on its arrival status.
|
// handle this packet based on its arrival status.
|
||||||
|
@ -134,7 +133,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
|
||||||
case SequenceNumberStats::OnTime: {
|
case SequenceNumberStats::OnTime: {
|
||||||
// Packet is on time; parse its data to the ringbuffer
|
// Packet is on time; parse its data to the ringbuffer
|
||||||
if (message.getType() == PacketType::SilentAudioFrame) {
|
if (message.getType() == PacketType::SilentAudioFrame) {
|
||||||
// FIXME - do some codecs need to know about these silen frames?
|
// FIXME - Some codecs need to know about these silent frames... and can produce better output
|
||||||
writeDroppableSilentSamples(networkSamples);
|
writeDroppableSilentSamples(networkSamples);
|
||||||
} else {
|
} else {
|
||||||
// note: PCM and no codec are identical
|
// note: PCM and no codec are identical
|
||||||
|
@ -144,10 +143,8 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
|
||||||
auto afterProperties = message.readWithoutCopy(message.getBytesLeftToRead());
|
auto afterProperties = message.readWithoutCopy(message.getBytesLeftToRead());
|
||||||
parseAudioData(message.getType(), afterProperties);
|
parseAudioData(message.getType(), afterProperties);
|
||||||
} else {
|
} else {
|
||||||
qDebug() << __FUNCTION__ << "codec mismatch: expected" << _selectedCodecName << "got" << codecInPacket << "writing silence";
|
qDebug() << "Codec mismatch: expected" << _selectedCodecName << "got" << codecInPacket << "writing silence";
|
||||||
|
|
||||||
writeDroppableSilentSamples(networkSamples);
|
writeDroppableSilentSamples(networkSamples);
|
||||||
|
|
||||||
// inform others of the mismatch
|
// inform others of the mismatch
|
||||||
auto sendingNode = DependencyManager::get<NodeList>()->nodeWithUUID(message.getSourceID());
|
auto sendingNode = DependencyManager::get<NodeList>()->nodeWithUUID(message.getSourceID());
|
||||||
emit mismatchedAudioCodec(sendingNode, _selectedCodecName);
|
emit mismatchedAudioCodec(sendingNode, _selectedCodecName);
|
||||||
|
|
|
@ -155,7 +155,6 @@ qint64 BasePacket::writeString(const QString& string) {
|
||||||
uint32_t length = data.length();
|
uint32_t length = data.length();
|
||||||
writePrimitive(length);
|
writePrimitive(length);
|
||||||
write(data.constData(), data.length());
|
write(data.constData(), data.length());
|
||||||
//seek(pos() + length);
|
|
||||||
return length + sizeof(uint32_t);
|
return length + sizeof(uint32_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue