static void jb_empty_and_reset_adaptive(void *jb) { jitterbuf *adaptivejb = jb; jb_frame f; while (jb_getall(adaptivejb, &f) == JB_OK) { ast_frfree(f.data); } jb_reset(adaptivejb); }
jitterbuf * jb_new() { jitterbuf *jb; if (!(jb = ast_malloc(sizeof(*jb)))) return NULL; jb_reset(jb); jb_dbg2("jb_new() = %x\n", jb); return jb; }
jitterbuf * jb_new() { jitterbuf *jb; jb = malloc(sizeof(jitterbuf)); if (!jb) return NULL; jb_reset(jb); jb_dbg2("jb_new() = %x\n", jb); return jb; }
jitterbuf * jb_new() { jitterbuf *jb; if (!(jb = (jitterbuf *)malloc(sizeof(*jb)))) return NULL; jb->info.conf.target_extra = JB_TARGET_EXTRA; jb_reset(jb); jb_dbg2("jb_new() = %x\n", jb); return jb; }
int jb_setconf(jitterbuf *jb, jb_conf *conf) { /* take selected settings from the struct */ if (conf->min_jitterbuf == -1) jb->info.target = jb->conf.min_jitterbuf = JB_TARGET_EXTRA; else jb->info.target = jb->conf.min_jitterbuf = conf->min_jitterbuf; jb->conf.max_jitterbuf = conf->max_jitterbuf; jb->conf.resync_threshold = conf->resync_threshold; jb->conf.max_contig_interp = conf->max_contig_interp; jb_reset(jb); return JB_OK; }
/*********** * empty nonvoice messages * empty voice messages * reset statistics * reset settings to default */ void jb_reset_all(jitterbuffer *jb) { jb_frame *frame; jb_dbg("r"); if (jb == NULL) { jb_err("no jitterbuffer in jb_reset_all()\n"); return; } // free nonvoice while(jb->controlframes) { frame = jb->controlframes; jb->controlframes = frame->next; frame_free(frame); } // free voice and reset statistics is done by jb_reset jb_reset(jb); set_default_settings(jb); }