diff options
Diffstat (limited to 'toxav/codec.c')
-rw-r--r-- | toxav/codec.c | 3 |
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, |