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