This commit is contained in:
Brad Hefta-Gaub 2016-07-18 22:45:28 -07:00
parent dbf60a594c
commit c484fec51d
2 changed files with 3 additions and 7 deletions

View file

@ -116,8 +116,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
// parse the info after the seq number and before the audio data (the stream properties)
int prePropertyPosition = message.getPosition();
auto afterHeader = message.readWithoutCopy(message.getBytesLeftToRead());
int propertyBytes = parseStreamProperties(message.getType(), afterHeader, networkSamples);
int propertyBytes = parseStreamProperties(message.getType(), message.readWithoutCopy(message.getBytesLeftToRead()), networkSamples);
message.seek(prePropertyPosition + propertyBytes);
// handle this packet based on its arrival status.
@ -134,7 +133,7 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
case SequenceNumberStats::OnTime: {
// Packet is on time; parse its data to the ringbuffer
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);
} else {
// note: PCM and no codec are identical
@ -144,10 +143,8 @@ int InboundAudioStream::parseData(ReceivedMessage& message) {
auto afterProperties = message.readWithoutCopy(message.getBytesLeftToRead());
parseAudioData(message.getType(), afterProperties);
} else {
qDebug() << __FUNCTION__ << "codec mismatch: expected" << _selectedCodecName << "got" << codecInPacket << "writing silence";
qDebug() << "Codec mismatch: expected" << _selectedCodecName << "got" << codecInPacket << "writing silence";
writeDroppableSilentSamples(networkSamples);
// inform others of the mismatch
auto sendingNode = DependencyManager::get<NodeList>()->nodeWithUUID(message.getSourceID());
emit mismatchedAudioCodec(sendingNode, _selectedCodecName);

View file

@ -155,7 +155,6 @@ qint64 BasePacket::writeString(const QString& string) {
uint32_t length = data.length();
writePrimitive(length);
write(data.constData(), data.length());
//seek(pos() + length);
return length + sizeof(uint32_t);
}