mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Fix NACK remove loop bug
This commit is contained in:
parent
4bcfce7ff1
commit
b7f5fa7c9d
2 changed files with 27 additions and 4 deletions
|
@ -146,10 +146,7 @@ SrsRtpPacket2* SrsRtpRingBuffer::at(uint16_t seq) {
|
||||||
|
|
||||||
void SrsRtpRingBuffer::notify_nack_list_full()
|
void SrsRtpRingBuffer::notify_nack_list_full()
|
||||||
{
|
{
|
||||||
while(begin <= end) {
|
clear_all_histroy();
|
||||||
remove(begin);
|
|
||||||
++begin;
|
|
||||||
}
|
|
||||||
|
|
||||||
begin = end = 0;
|
begin = end = 0;
|
||||||
initialized_ = false;
|
initialized_ = false;
|
||||||
|
@ -161,6 +158,29 @@ void SrsRtpRingBuffer::notify_drop_seq(uint16_t seq)
|
||||||
advance_to(seq+1);
|
advance_to(seq+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SrsRtpRingBuffer::clear_histroy(uint16_t seq)
|
||||||
|
{
|
||||||
|
// TODO FIXME Did not consider loopback
|
||||||
|
for (uint16_t i = 0; i < capacity_; i++) {
|
||||||
|
SrsRtpPacket2* p = queue_[i];
|
||||||
|
if (p && p->header.get_sequence() < seq) {
|
||||||
|
srs_freep(p);
|
||||||
|
queue_[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SrsRtpRingBuffer::clear_all_histroy()
|
||||||
|
{
|
||||||
|
for (uint16_t i = 0; i < capacity_; i++) {
|
||||||
|
SrsRtpPacket2* p = queue_[i];
|
||||||
|
if (p) {
|
||||||
|
srs_freep(p);
|
||||||
|
queue_[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SrsNackOption::SrsNackOption()
|
SrsNackOption::SrsNackOption()
|
||||||
{
|
{
|
||||||
max_count = 15;
|
max_count = 15;
|
||||||
|
|
|
@ -87,6 +87,9 @@ public:
|
||||||
// TODO: FIXME: Refine it?
|
// TODO: FIXME: Refine it?
|
||||||
void notify_nack_list_full();
|
void notify_nack_list_full();
|
||||||
void notify_drop_seq(uint16_t seq);
|
void notify_drop_seq(uint16_t seq);
|
||||||
|
public:
|
||||||
|
void clear_histroy(uint16_t seq);
|
||||||
|
void clear_all_histroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SrsNackOption
|
struct SrsNackOption
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue