[asterisk-commits] mmichelson: branch mmichelson/issue11259 r135751 - /team/mmichelson/issue1125...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 5 17:19:20 CDT 2008


Author: mmichelson
Date: Tue Aug  5 17:19:20 2008
New Revision: 135751

URL: http://svn.digium.com/view/asterisk?view=rev&rev=135751
Log:
Add a call to ast_jb_empty_and_reset at the beginning
of the ast_generic_bridge function since we will want to
reset the jitterbuffer each time the bridge is broken
to do things such as play an audio file.

I also fixed some pointer dumbness that I had managed
to put in the empty_and_reset implementations.

This set of changes seems to fix the issue at hand. I think
the only things left to do are hash out a reset function for
the fixed jb and test.


Modified:
    team/mmichelson/issue11259/main/abstract_jb.c
    team/mmichelson/issue11259/main/channel.c
    team/mmichelson/issue11259/main/file.c

Modified: team/mmichelson/issue11259/main/abstract_jb.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/issue11259/main/abstract_jb.c?view=diff&rev=135751&r1=135750&r2=135751
==============================================================================
--- team/mmichelson/issue11259/main/abstract_jb.c (original)
+++ team/mmichelson/issue11259/main/abstract_jb.c Tue Aug  5 17:19:20 2008
@@ -720,10 +720,10 @@
 static void jb_empty_and_reset_fixed(void *jb)
 {
 	struct fixed_jb *fixedjb = jb;
-	struct fixed_jb_frame *f = NULL;
-
-	while (fixed_jb_remove(fixedjb, f) == FIXED_JB_OK) {
-		ast_frfree(f->data);
+	struct fixed_jb_frame f;
+
+	while (fixed_jb_remove(fixedjb, &f) == FIXED_JB_OK) {
+		ast_frfree(f.data);
 	}
 
 	fixed_jb_reset(fixedjb);
@@ -814,10 +814,10 @@
 static void jb_empty_and_reset_adaptive(void *jb)
 {
 	jitterbuf *adaptivejb = jb;
-	jb_frame *f = NULL;
-
-	while (jb_getall(adaptivejb, f) == JB_OK) {
-		ast_frfree(f->data);
+	jb_frame f;
+
+	while (jb_getall(adaptivejb, &f) == JB_OK) {
+		ast_frfree(f.data);
 	}
 
 	jb_reset(adaptivejb);

Modified: team/mmichelson/issue11259/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/issue11259/main/channel.c?view=diff&rev=135751&r1=135750&r2=135751
==============================================================================
--- team/mmichelson/issue11259/main/channel.c (original)
+++ team/mmichelson/issue11259/main/channel.c Tue Aug  5 17:19:20 2008
@@ -3774,6 +3774,8 @@
 
 	/* Check the need of a jitterbuffer for each channel */
 	jb_in_use = ast_jb_do_usecheck(c0, c1);
+	if (jb_in_use)
+		ast_jb_empty_and_reset(c0, c1);
 
 	for (;;) {
 		struct ast_channel *who, *other;
@@ -3839,6 +3841,7 @@
 			case AST_CONTROL_SRCUPDATE:
 				ast_indicate_data(other, f->subclass, f->data, f->datalen);
 				if (jb_in_use) {
+					ast_log(LOG_NOTICE, "I should be emptying and resetting the freaking jitterbuffer...\n");
 					ast_jb_empty_and_reset(c0, c1);
 				}
 				break;
@@ -3891,6 +3894,7 @@
 		cs[0] = cs[1];
 		cs[1] = cs[2];
 	}
+	ast_log(LOG_NOTICE, "Curious....when do we return from here?\n");
 	return res;
 }
 

Modified: team/mmichelson/issue11259/main/file.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/issue11259/main/file.c?view=diff&rev=135751&r1=135750&r2=135751
==============================================================================
--- team/mmichelson/issue11259/main/file.c (original)
+++ team/mmichelson/issue11259/main/file.c Tue Aug  5 17:19:20 2008
@@ -901,6 +901,7 @@
 			return -1;
 		if (vfs && ast_applystream(chan, vfs))
 			return -1;
+		ast_queue_control(chan, AST_CONTROL_SRCUPDATE);
 		res = ast_playstream(fs);
 		if (!res && vfs)
 			res = ast_playstream(vfs);




More information about the asterisk-commits mailing list