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,18 +91,18 @@ void JitterBuffer::PutInternal(jitter_packet_t &pkt, bool overwriteExisting)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overwriteExisting)
|
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())
|
||||||
{
|
{
|
||||||
for (auto &slot : slots)
|
if (overwriteExisting)
|
||||||
{
|
{
|
||||||
if (slot.timestamp == pkt.timestamp && !slot.buffer.IsEmpty())
|
existing->buffer.CopyFromOtherBuffer(pkt.buffer, pkt.size);
|
||||||
{
|
existing->size = pkt.size;
|
||||||
slot.buffer.CopyFromOtherBuffer(pkt.buffer, pkt.size);
|
existing->isEC = pkt.isEC;
|
||||||
slot.size = pkt.size;
|
|
||||||
slot.isEC = pkt.isEC;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gotSinceReset++;
|
gotSinceReset++;
|
||||||
|
Loading…
Reference in New Issue
Block a user