jbuf: use seq_get not only for statistics
@@ -53,10 +53,10 @@ struct jbuf {
uint32_t min; /**< [# frames] Minimum # of frames to buffer */
uint32_t max; /**< [# frames] Maximum # of frames to buffer */
uint16_t seq_put; /**< Sequence number for last jbuf_put() */
+ uint16_t seq_get; /**< Sequence number of last played frame */
bool running; /**< Jitter buffer is running */
#if JBUF_STAT
- uint16_t seq_get; /**< Timestamp of last played frame */
struct jbuf_stat stat; /**< Jitter buffer Statistics */
#endif
};
@@ -315,10 +315,10 @@ int jbuf_get(struct jbuf *jb, struct rtp_header *hdr, void **mem)
seq_diff, f->hdr.seq, jb->seq_get);
}
}
+#endif
/* Update sequence number for 'get' */
jb->seq_get = f->hdr.seq;
-#endif
*hdr = f->hdr;
*mem = mem_ref(f->mem);
@@ -359,9 +359,9 @@ void jbuf_flush(struct jbuf *jb)
jb->n = 0;
jb->running = false;
+ jb->seq_get = 0;
#if JBUF_STAT
n_flush = STAT_INC(n_flush);
- jb->seq_get = 0;
memset(&jb->stat, 0, sizeof(jb->stat));
jb->stat.n_flush = n_flush;
#endif
