diff options
author | irungentoo <irungentoo@gmail.com> | 2014-11-29 16:13:50 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-11-29 16:13:50 -0500 |
commit | 1c3f88758db4325de36294c9f4682980c4198cc7 (patch) | |
tree | 6c8708dca730ed9fd78dae8a0d257abfc0bd45d0 /toxav/codec.c | |
parent | e254c4fe3e7431a22614851156648e9ae8ff9577 (diff) |
Jbuff fixes.
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, |