aboutsummaryrefslogtreecommitdiffstats
path: root/main/jitterbuf.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-29 16:54:27 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-29 16:54:27 +0000
commitf874250d6392281357d8f357e4161fc007f82821 (patch)
tree612a65475a8c8569b2176941c87a29a29a745519 /main/jitterbuf.c
parent2061f7c67b27e4a1382dee603b59ba236f8202ea (diff)
Clean up a few things in the last commit to the adaptive jitterbuffer code.
- Specifically indicate to the compiler that the "dropem" variable only needs one but. - Change formatting to conform to coding guidelines. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@52506 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/jitterbuf.c')
-rw-r--r--main/jitterbuf.c23
1 files changed, 12 insertions, 11 deletions
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;