fix seeks in InboundAudioStream

This commit is contained in:
Stephen Birarda 2015-07-17 15:59:24 -07:00
parent 35c8a60f3b
commit 39272652e5

View file

@ -112,9 +112,10 @@ int InboundAudioStream::parseData(NLPacket& packet) {
int networkSamples;
// parse the info after the seq number and before the audio data (the stream properties)
int prePropertyPosition = packet.pos();
int propertyBytes = parseStreamProperties(packet.getType(), packet.read(packet.bytesLeftToRead()), networkSamples);
packet.seek(packet.pos() + propertyBytes);
packet.seek(prePropertyPosition + propertyBytes);
// handle this packet based on its arrival status.
switch (arrivalInfo._status) {
case SequenceNumberStats::Early: {
@ -132,7 +133,6 @@ int InboundAudioStream::parseData(NLPacket& packet) {
writeDroppableSilentSamples(networkSamples);
} else {
int audioBytes = parseAudioData(packet.getType(), packet.read(packet.bytesLeftToRead()), networkSamples);
packet.seek(packet.pos() + audioBytes);
}
break;
}