mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-30 04:39:03 +01:00
FIx
This commit is contained in:
parent
442326e814
commit
5367ab3e68
@ -91,19 +91,19 @@ void JitterBuffer::PutInternal(jitter_packet_t &pkt, bool overwriteExisting)
|
||||
return;
|
||||
}
|
||||
|
||||
auto existing = std::find_if(slots.begin(), slots.end(), [timestamp = pkt.timestamp](const jitter_packet_t &slot) -> bool {
|
||||
return slot.timestamp == timestamp && !slot.buffer.IsEmpty();
|
||||
});
|
||||
if (existing != slots.end())
|
||||
{
|
||||
if (overwriteExisting)
|
||||
{
|
||||
for (auto &slot : slots)
|
||||
{
|
||||
if (slot.timestamp == pkt.timestamp && !slot.buffer.IsEmpty())
|
||||
{
|
||||
slot.buffer.CopyFromOtherBuffer(pkt.buffer, pkt.size);
|
||||
slot.size = pkt.size;
|
||||
slot.isEC = pkt.isEC;
|
||||
existing->buffer.CopyFromOtherBuffer(pkt.buffer, pkt.size);
|
||||
existing->size = pkt.size;
|
||||
existing->isEC = pkt.isEC;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gotSinceReset++;
|
||||
if (wasReset)
|
||||
|
Loading…
Reference in New Issue
Block a user