[asterisk-commits] dvossel: branch dvossel/jb_ftw r311980 - /team/dvossel/jb_ftw/funcs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 31 11:01:35 CDT 2011


Author: dvossel
Date: Thu Mar 31 11:01:31 2011
New Revision: 311980

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=311980
Log:
Added debug info

Modified:
    team/dvossel/jb_ftw/funcs/func_jitterbuffer.c

Modified: team/dvossel/jb_ftw/funcs/func_jitterbuffer.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/jb_ftw/funcs/func_jitterbuffer.c?view=diff&rev=311980&r1=311979&r2=311980
==============================================================================
--- team/dvossel/jb_ftw/funcs/func_jitterbuffer.c (original)
+++ team/dvossel/jb_ftw/funcs/func_jitterbuffer.c Thu Mar 31 11:01:31 2011
@@ -56,6 +56,10 @@
 		framedata->timer = NULL;
 	}
 	if (framedata->jb_impl && framedata->jb_obj) {
+		struct ast_frame *f;
+		while (framedata->jb_impl->remove(framedata->jb_obj, &f) == AST_JB_IMPL_OK) {
+			ast_frfree(f);
+		}
 		framedata->jb_impl->destroy(framedata->jb_obj);
 		framedata->jb_obj = NULL;
 	}
@@ -65,7 +69,7 @@
 {
 //todohere eventually this should take a custom jb config, for testing this is all hardcoded at the moment.
 	framedata->timer_fd = -1;
-	if (!(framedata->jb_impl = ast_jb_get_impl(AST_JB_ADAPTIVE))) {
+	if (!(framedata->jb_impl = ast_jb_get_impl(AST_JB_FIXED))) {
 		return -1;
 	}
 
@@ -79,10 +83,10 @@
 	framedata->last_tv = framedata->start_tv;
 
 //todohere setup fake conf
-	framedata->jb_conf.max_size = 200;
-	framedata->jb_conf.resync_threshold = 1000;
-	ast_copy_string(framedata->jb_conf.impl, "adaptive", sizeof(framedata->jb_conf.impl));
-	framedata->jb_conf.target_extra = 40;
+	framedata->jb_conf.max_size = 500;
+	framedata->jb_conf.resync_threshold = 2000;
+	ast_copy_string(framedata->jb_conf.impl, "fixed", sizeof(framedata->jb_conf.impl));
+	framedata->jb_conf.target_extra = 1000;
 
 	framedata->jb_obj = framedata->jb_impl->create(&framedata->jb_conf, 1000);
 
@@ -136,7 +140,7 @@
 
 		// ---todohere DEBUG 
 		framedata->jb_impl->put(framedata->jb_obj, frame, now);
-
+		printf("---> PUT\n");
 		frame = &ast_null_frame;
 	}
 
@@ -154,6 +158,7 @@
 		case AST_JB_IMPL_OK:
 //			printf("----- diff: %lu now: %lu next: %lu\n", ast_tvdiff_ms(now_tv, framedata->last_tv), now, next);
 //			framedata->last_tv = now_tv;
+			printf("<--- get\n");
 			break;
 		case AST_JB_IMPL_DROP:
 			ast_frfree(frame);




More information about the asterisk-commits mailing list