mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 15:23:05 +02:00
Fix parsing of silent packets properties
This commit is contained in:
parent
b5abf44aa3
commit
0a9a6f1ef8
1 changed files with 10 additions and 3 deletions
|
@ -169,9 +169,16 @@ int InboundAudioStream::parseData(const QByteArray& packet) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int InboundAudioStream::parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) {
|
int InboundAudioStream::parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) {
|
||||||
// mixed audio packets do not have any info between the seq num and the audio data.
|
if (type == PacketTypeSilentAudioFrame) {
|
||||||
numAudioSamples = packetAfterSeqNum.size() / sizeof(int16_t);
|
quint16 numSilentSamples = 0;
|
||||||
return 0;
|
memcpy(&numSilentSamples, packetAfterSeqNum.constData(), sizeof(quint16));
|
||||||
|
numAudioSamples = numSilentSamples;
|
||||||
|
return sizeof(quint16);
|
||||||
|
} else {
|
||||||
|
// mixed audio packets do not have any info between the seq num and the audio data.
|
||||||
|
numAudioSamples = packetAfterSeqNum.size() / sizeof(int16_t);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int InboundAudioStream::parseAudioData(PacketType type, const QByteArray& packetAfterStreamProperties, int numAudioSamples) {
|
int InboundAudioStream::parseAudioData(PacketType type, const QByteArray& packetAfterStreamProperties, int numAudioSamples) {
|
||||||
|
|
Loading…
Reference in a new issue