The head of the queue is the oldest packet (as in lowest seqnum), the tail is
the newest packet. To calculate the fill level, we should calculate tail-head
while considering wraparounds. Not the other way around.
Other code is already doing this in the correct order.
https://bugzilla.gnome.org/show_bug.cgi?id=764889
g_return_val_if_fail (jbuf != NULL, 0);
- high_buf = (RTPJitterBufferItem *) g_queue_peek_head_link (jbuf->packets);
- low_buf = (RTPJitterBufferItem *) g_queue_peek_tail_link (jbuf->packets);
+ high_buf = (RTPJitterBufferItem *) g_queue_peek_tail_link (jbuf->packets);
+ low_buf = (RTPJitterBufferItem *) g_queue_peek_head_link (jbuf->packets);
if (!high_buf || !low_buf || high_buf == low_buf)
return 0;