[svn-commits] dvossel: branch dvossel/fixtheworld_phase1_step3 r303196 - /team/dvossel/fixt...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 20 16:03:43 CST 2011


Author: dvossel
Date: Thu Jan 20 16:03:39 2011
New Revision: 303196

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=303196
Log:
conversion of app_jack to ast_format api

Modified:
    team/dvossel/fixtheworld_phase1_step3/apps/app_jack.c

Modified: team/dvossel/fixtheworld_phase1_step3/apps/app_jack.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/apps/app_jack.c?view=diff&rev=303196&r1=303195&r2=303196
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/apps/app_jack.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/apps/app_jack.c Thu Jan 20 16:03:39 2011
@@ -604,12 +604,12 @@
 	short buf[160];
 	struct ast_frame f = {
 		.frametype = AST_FRAME_VOICE,
-		.subclass.codec = AST_FORMAT_SLINEAR,
 		.src = "JACK",
 		.data.ptr = buf,
 		.datalen = sizeof(buf),
 		.samples = ARRAY_LEN(buf),
 	};
+	ast_format_set(&f.subclass.format, AST_FORMAT_SLINEAR, 0);
 
 	for (;;) {
 		size_t res, read_len;
@@ -754,12 +754,12 @@
 		return -1;
 	}
 
-	if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
+	if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) {
 		destroy_jack_data(jack_data);
 		return -1;
 	}
 
-	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) {
+	if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR)) {
 		destroy_jack_data(jack_data);
 		return -1;
 	}
@@ -823,9 +823,9 @@
 	if (frame->frametype != AST_FRAME_VOICE)
 		return 0;
 
-	if (frame->subclass.codec != AST_FORMAT_SLINEAR) {
+	if (frame->subclass.format.id != AST_FORMAT_SLINEAR) {
 		ast_log(LOG_WARNING, "Expected frame in SLINEAR for the audiohook, but got format %s\n",
-			ast_getformatname(frame->subclass.codec));
+			ast_getformatname(&frame->subclass.format));
 		return 0;
 	}
 




More information about the svn-commits mailing list