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

@ -113,7 +113,7 @@ int InboundAudioStream::parseData(NLPacket& packet) {
// 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 propertyBytes = parseStreamProperties(packet.getType(), int propertyBytes = parseStreamProperties(packet.getType(),
QByteArray::fromRawData(packet.getPayload(), packet.pos()), QByteArray::fromRawData(packet.getPayload(), packet.bytesLeftToRead()),
networkSamples); networkSamples);
packet.seek(packet.pos() + propertyBytes); packet.seek(packet.pos() + propertyBytes);

View file

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

View file

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