[asterisk-commits] russell: branch group/asterisk-cpp r168407 - /team/group/asterisk-cpp/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 10 19:19:41 CST 2009


Author: russell
Date: Sat Jan 10 19:19:40 2009
New Revision: 168407

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168407
Log:
fix audiohook.c

Modified:
    team/group/asterisk-cpp/main/audiohook.c

Modified: team/group/asterisk-cpp/main/audiohook.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/audiohook.c?view=diff&rev=168407&r1=168406&r2=168407
==============================================================================
--- team/group/asterisk-cpp/main/audiohook.c (original)
+++ team/group/asterisk-cpp/main/audiohook.c Sat Jan 10 19:19:40 2009
@@ -161,7 +161,12 @@
 	struct ast_slinfactory *factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_factory : &audiohook->write_factory);
 	int vol = (direction == AST_AUDIOHOOK_DIRECTION_READ ? audiohook->options.read_volume : audiohook->options.write_volume);
 	short buf[samples];
-	struct ast_frame frame(AST_FRAME_VOICE, AST_FORMAT_SLINEAR, sizeof(buf), samples, (void *) buf);
+	struct ast_frame frame = { AST_FRAME_VOICE, };
+
+	frame.subclass = AST_FORMAT_SLINEAR;
+	frame.datalen = sizeof(buf);
+	frame.data.ptr = (void *) buf;
+	frame.samples = samples;
 
 	/* Ensure the factory is able to give us the samples we want */
 	if (samples > ast_slinfactory_available(factory))
@@ -183,7 +188,11 @@
 	int usable_read, usable_write;
 	size_t i = 0;
 	short buf1[samples], buf2[samples], *read_buf = NULL, *write_buf = NULL, *final_buf = NULL, *data1 = NULL, *data2 = NULL;
-	struct ast_frame frame(AST_FRAME_VOICE, AST_FORMAT_SLINEAR, sizeof(buf1), samples);
+	struct ast_frame frame = { AST_FRAME_VOICE, };
+	
+	frame.subclass = AST_FORMAT_SLINEAR; 
+	frame.datalen = sizeof(buf1);
+	frame.samples = samples;
 
 	/* Make sure both factories have the required samples */
 	usable_read = (ast_slinfactory_available(&audiohook->read_factory) >= samples ? 1 : 0);




More information about the asterisk-commits mailing list