Skip to content

Commit

Permalink
jbuf: delay buffer shrink after last out-of-order packet
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Sep 28, 2023
1 parent 836b32f commit 9965630
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jbuf/jbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
#endif

enum {
JBUF_RDIFF_EMA_COEFF = 1024,
JBUF_RDIFF_UP_SPEED = 512,
JBUF_PUT_TIMEOUT = 400,
JBUF_WAIT_TIMEOUT = 1000,
};


Expand Down Expand Up @@ -421,7 +420,7 @@ static void eagain_later(struct jbuf *jb)
if (tmr_isrunning(&jb->tmr))
return;

tmr_start(&jb->tmr, 250, reset_wait, jb);
tmr_start(&jb->tmr, JBUF_WAIT_TIMEOUT, reset_wait, jb);
}


Expand Down Expand Up @@ -504,6 +503,7 @@ int jbuf_put(struct jbuf *jb, const struct rtp_header *hdr, void *mem)
" - inserting after seq=%u (seq=%u)\n",
seq_le, seq);
list_insert_after(&jb->packetl, le, &p->le, p);
tmr_start(&jb->tmr, JBUF_WAIT_TIMEOUT, reset_wait, jb);
break;
}
else if (seq == seq_le) { /* less likely */
Expand Down Expand Up @@ -539,7 +539,7 @@ int jbuf_put(struct jbuf *jb, const struct rtp_header *hdr, void *mem)
p->hdr = *hdr;
p->mem = mem_ref(mem);
if (tail && ((struct packet *)tail->data)->hdr.ts != hdr->ts) {
jb->nf++;
++jb->nf;
jb->wait = false;
}

Expand Down

0 comments on commit 9965630

Please sign in to comment.