mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@52506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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?) */
|
||||
|
@@ -518,7 +518,8 @@ 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);
|
||||
if (jb->frames && jb->dropem)
|
||||
return JB_DROP;
|
||||
jb->dropem = 0;
|
||||
|
||||
if (type == JB_TYPE_VOICE) {
|
||||
@@ -528,11 +529,11 @@ enum jb_return_code jb_put(jitterbuf *jb, void *data, const enum jb_frame_type t
|
||||
return JB_DROP;
|
||||
}
|
||||
numts = 0;
|
||||
if (jb->frames) {
|
||||
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);
|
||||
ast_log(LOG_DEBUG, "Attempting to exceed Jitterbuf max %ld timeslots\n",
|
||||
jb->info.conf.max_jitterbuf);
|
||||
jb->dropem = 1;
|
||||
return JB_DROP;
|
||||
}
|
||||
|
Reference in New Issue
Block a user