Skip to content

Commit

Permalink
jbuf: simplify rdiff computation
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Sep 20, 2023
1 parent d7ad3e6 commit 583cffe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/jbuf/jbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,7 @@ static void calc_rdiff(struct jbuf *jb, uint16_t seq)

rdiff = (int16_t)(jb->seq_put + 1 - seq);
adiff = abs(rdiff * JBUF_RDIFF_EMA_COEFF);
s = adiff > jb->rdiff ? JBUF_RDIFF_UP_SPEED :
jb->wish > 2 ? 1 :
jb->wish > 1 ? 2 : 3;
s = adiff > jb->rdiff ? JBUF_RDIFF_UP_SPEED : 1;
jb->rdiff += (adiff - jb->rdiff) * s / JBUF_RDIFF_EMA_COEFF;

wish = (uint32_t)(jb->rdiff / (float)JBUF_RDIFF_EMA_COEFF);
Expand Down

0 comments on commit 583cffe

Please sign in to comment.