|
@@ -1,4 +1,5 @@
|
|
|
#include "jbuf.h"
|
|
|
+#include "jerrno.h"
|
|
|
|
|
|
#include <memory.h>
|
|
|
#include <assert.h>
|
|
@@ -446,7 +447,7 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
|
|
|
if (index < framelist->origin) {
|
|
|
if (framelist->origin - index < MAX_MISORDER) {
|
|
|
/* too late */
|
|
|
- return -1;
|
|
|
+ return PJ_ETOOSMALL;
|
|
|
} else {
|
|
|
/* sequence restart */
|
|
|
framelist->origin = index - framelist->size;
|
|
@@ -471,7 +472,7 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
|
|
|
distance = 0;
|
|
|
} else {
|
|
|
/* otherwise, reject the frame */
|
|
|
- return -1;
|
|
|
+ return PJ_ETOOMANY;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -480,7 +481,7 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
|
|
|
|
|
|
/* if the slot is occupied, it must be duplicated frame, ignore it. */
|
|
|
if (framelist->frame_type[pos] != JB_MISSING_FRAME)
|
|
|
- return -1;
|
|
|
+ return PJ_EEXISTS;
|
|
|
|
|
|
/* put the frame into the slot */
|
|
|
framelist->frame_type[pos] = frame_type;
|
|
@@ -495,11 +496,11 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
|
|
|
/* copy frame content */
|
|
|
memcpy(framelist->content + pos * framelist->frame_size,
|
|
|
frame, frame_size);
|
|
|
- return 0;
|
|
|
+ return PJ_SUCCESS;
|
|
|
} else {
|
|
|
/* frame is being discarded */
|
|
|
framelist->discarded_num++;
|
|
|
- return -1;
|
|
|
+ return PJ_EIGNORED;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -831,7 +832,7 @@ default:
|
|
|
min_frame_size, bit_info, frame_type);
|
|
|
|
|
|
/* Jitter buffer is full, remove some older frames */
|
|
|
- while (status == -1) {
|
|
|
+ while (status == PJ_ETOOMANY) {
|
|
|
int distance;
|
|
|
unsigned removed;
|
|
|
|
|
@@ -861,9 +862,9 @@ default:
|
|
|
|
|
|
/* Return the flag if this frame is discarded */
|
|
|
if (discarded)
|
|
|
- *discarded = (status != 0);
|
|
|
+ *discarded = (status != PJ_SUCCESS);
|
|
|
|
|
|
- if (status == 0) {
|
|
|
+ if (status == PJ_SUCCESS) {
|
|
|
if (jb->jb_status == JB_STATUS_PREFETCHING) {
|
|
|
if (new_size >= jb->jb_prefetch)
|
|
|
jb->jb_status = JB_STATUS_PROCESSING;
|