mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +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) {
|
||||
// mixed audio packets do not have any info between the seq num and the audio data.
|
||||
numAudioSamples = packetAfterSeqNum.size() / sizeof(int16_t);
|
||||
return 0;
|
||||
if (type == PacketTypeSilentAudioFrame) {
|
||||
quint16 numSilentSamples = 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) {
|
||||
|
|
Loading…
Reference in a new issue