aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/jitterbuf.h3
-rw-r--r--main/jitterbuf.c23
2 files changed, 13 insertions, 13 deletions
diff --git a/include/jitterbuf.h b/include/jitterbuf.h
index 5694f7b6c..dac903e83 100644
--- a/include/jitterbuf.h
+++ b/include/jitterbuf.h
@@ -103,8 +103,7 @@ typedef struct jitterbuf {
long hist_maxbuf[JB_HISTORY_MAXBUF_SZ]; /* a sorted buffer of the max delays (highest first) */
long hist_minbuf[JB_HISTORY_MAXBUF_SZ]; /* a sorted buffer of the min delays (lowest first) */
int hist_maxbuf_valid; /* are the "maxbuf"/minbuf valid? */
- int dropem; /* flag to indicate dropping frames (overload) */
-
+ unsigned int dropem:1; /* flag to indicate dropping frames (overload) */
jb_frame *frames; /* queued frames */
jb_frame *free; /* free frames (avoid malloc?) */
diff --git a/main/jitterbuf.c b/main/jitterbuf.c
index f87e273b6..2b081704a 100644
--- a/main/jitterbuf.c
+++ b/main/jitterbuf.c
@@ -518,8 +518,9 @@ enum jb_return_code jb_put(jitterbuf *jb, void *data, const enum jb_frame_type t
jb->info.frames_in++;
- if (jb->frames && jb->dropem) return(JB_DROP);
- jb->dropem = 0;
+ if (jb->frames && jb->dropem)
+ return JB_DROP;
+ jb->dropem = 0;
if (type == JB_TYPE_VOICE) {
/* presently, I'm only adding VOICE frames to history and drift calculations; mostly because with the
@@ -527,15 +528,15 @@ enum jb_return_code jb_put(jitterbuf *jb, void *data, const enum jb_frame_type t
if (history_put(jb,ts,now,ms))
return JB_DROP;
}
- numts = 0;
- if (jb->frames) {
- numts = jb->frames->prev->ts - jb->frames->ts;
- }
- if (numts >= jb->info.conf.max_jitterbuf) {
- ast_log(LOG_NOTICE,"Attempting to exceed Jitterbuf max %ld timeslots\n",jb->info.conf.max_jitterbuf);
- jb->dropem = 1;
- return JB_DROP;
- }
+ numts = 0;
+ if (jb->frames)
+ numts = jb->frames->prev->ts - jb->frames->ts;
+ if (numts >= jb->info.conf.max_jitterbuf) {
+ ast_log(LOG_DEBUG, "Attempting to exceed Jitterbuf max %ld timeslots\n",
+ jb->info.conf.max_jitterbuf);
+ jb->dropem = 1;
+ return JB_DROP;
+ }
/* if put into head of queue, caller needs to reschedule */
if (queue_put(jb,data,type,ms,ts)) {
return JB_SCHED;