[asterisk-commits] file: branch group/media_formats r408295 - /team/group/media_formats/apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 18 06:47:14 CST 2014


Author: file
Date: Tue Feb 18 06:47:12 2014
New Revision: 408295

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408295
Log:
Move app_jack over.

Modified:
    team/group/media_formats/apps/app_jack.c

Modified: team/group/media_formats/apps/app_jack.c
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/apps/app_jack.c?view=diff&rev=408295&r1=408294&r2=408295
==============================================================================
--- team/group/media_formats/apps/app_jack.c (original)
+++ team/group/media_formats/apps/app_jack.c Tue Feb 18 06:47:12 2014
@@ -58,6 +58,7 @@
 #include "asterisk/app.h"
 #include "asterisk/pbx.h"
 #include "asterisk/audiohook.h"
+#include "asterisk/format_cache.h"
 
 #define RESAMPLE_QUALITY 1
 
@@ -605,12 +606,12 @@
 	short buf[160];
 	struct ast_frame f = {
 		.frametype = AST_FRAME_VOICE,
+		.subclass.format = ast_format_slin,
 		.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;
@@ -755,12 +756,12 @@
 		return -1;
 	}
 
-	if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) {
+	if (ast_set_read_format(chan, ast_format_slin)) {
 		destroy_jack_data(jack_data);
 		return -1;
 	}
 
-	if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR)) {
+	if (ast_set_write_format(chan, ast_format_slin)) {
 		destroy_jack_data(jack_data);
 		return -1;
 	}
@@ -826,9 +827,9 @@
 	if (frame->frametype != AST_FRAME_VOICE)
 		return 0;
 
-	if (frame->subclass.format.id != AST_FORMAT_SLINEAR) {
+	if (ast_format_cmp(frame->subclass.format, ast_format_slin) != AST_FORMAT_CMP_EQUAL) {
 		ast_log(LOG_WARNING, "Expected frame in SLINEAR for the audiohook, but got format %s\n",
-			ast_getformatname(&frame->subclass.format));
+			frame->subclass.format->codec->name);
 		return 0;
 	}
 




More information about the asterisk-commits mailing list