summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-11-29 16:13:50 -0500
committerirungentoo <irungentoo@gmail.com>2014-11-29 16:13:50 -0500
commit1c3f88758db4325de36294c9f4682980c4198cc7 (patch)
tree6c8708dca730ed9fd78dae8a0d257abfc0bd45d0
parente254c4fe3e7431a22614851156648e9ae8ff9577 (diff)
Jbuff fixes.
-rw-r--r--toxav/codec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toxav/codec.c b/toxav/codec.c
index 776ca940..eb770f39 100644
--- a/toxav/codec.c
+++ b/toxav/codec.c
@@ -178,7 +178,7 @@ static void jbuf_write(JitterBuffer *q, RTPMessage *m)
178 178
179 if ((uint32_t)(sequnum - q->bottom) > q->size) { 179 if ((uint32_t)(sequnum - q->bottom) > q->size) {
180 jbuf_clear(q); 180 jbuf_clear(q);
181 q->bottom = sequnum; 181 q->bottom = sequnum - q->capacity;
182 q->queue[num] = m; 182 q->queue[num] = m;
183 q->top = sequnum + 1; 183 q->top = sequnum + 1;
184 return; 184 return;
@@ -191,6 +191,7 @@ static void jbuf_write(JitterBuffer *q, RTPMessage *m)
191 191
192 if ((sequnum - q->bottom) >= (q->top - q->bottom)) 192 if ((sequnum - q->bottom) >= (q->top - q->bottom))
193 q->top = sequnum + 1; 193 q->top = sequnum + 1;
194
194} 195}
195 196
196/* Success is 0 when there is nothing to dequeue, 197/* Success is 0 when there is nothing to dequeue,