fix fromRawData call for silent audio packet

This commit is contained in:
Stephen Birarda 2015-07-15 15:41:45 -07:00
commit 52fdce4a44
3 changed files with 4 additions and 4 deletions

View file

@ -110,10 +110,10 @@ int InboundAudioStream::parseData(NLPacket& packet) {
packetReceivedUpdateTimingStats();
int networkSamples;
// parse the info after the seq number and before the audio data (the stream properties)
int propertyBytes = parseStreamProperties(packet.getType(),
QByteArray::fromRawData(packet.getPayload(), packet.pos()),
QByteArray::fromRawData(packet.getPayload(), packet.bytesLeftToRead()),
networkSamples);
packet.seek(packet.pos() + propertyBytes);

View file

@ -496,7 +496,7 @@ unsigned int LimitedNodeList::broadcastToNodes(std::unique_ptr<NLPacket> packet,
unsigned int n = 0;
eachNode([&](const SharedNodePointer& node){
if (destinationNodeTypes.contains(node->getType())) {
if (node->getActiveSocket() && destinationNodeTypes.contains(node->getType())) {
writePacket(*packet, *node->getActiveSocket(), node->getConnectionSecret());
++n;
}

View file

@ -147,7 +147,7 @@ void Packet::setPayloadSize(qint64 payloadSize) {
bool Packet::reset() {
if (isWritable()) {
setPayloadSize(0);
_payloadSize = 0;
}
return QIODevice::reset();