diff --git a/lib/codeclib.c b/lib/codeclib.c index a7d0a984f..d9ca228da 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -578,7 +578,8 @@ int packet_sequencer_insert(packet_sequencer_t *ps, seq_packet_t *p) { if (G_LIKELY(diff >= 0 && diff < G_N_ELEMENTS(ps->packets))) goto seq_ok; // early packet with wrap-around: p->seq = 20, ps->a_seq = 65530, diff = -65510 - if (diff < (-0xffff + (signed) G_N_ELEMENTS(ps->packets))) + // (a packet exactly one ring size ahead is a seq reset, same as without wrap-around) + if (diff < (-0x10000 + (signed) G_N_ELEMENTS(ps->packets))) goto seq_ok; // recent duplicate: p->seq = 1000, ps->seq = 1080, diff = -80 if (diff < 0 && diff > -(signed) G_N_ELEMENTS(ps->packets))