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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 20 11:46:00 CST 2011


Author: dvossel
Date: Thu Jan 20 11:45:56 2011
New Revision: 303097

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

Modified:
    team/dvossel/fixtheworld_phase1_step3/addons/format_mp3.c

Modified: team/dvossel/fixtheworld_phase1_step3/addons/format_mp3.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/addons/format_mp3.c?view=diff&rev=303097&r1=303096&r2=303097
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/addons/format_mp3.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/addons/format_mp3.c Thu Jan 20 11:45:56 2011
@@ -224,7 +224,7 @@
 	p->offset += p->buflen;
 	delay = p->buflen/2;
 	s->fr.frametype = AST_FRAME_VOICE;
-	s->fr.subclass.codec = AST_FORMAT_SLINEAR;
+	ast_format_set(&s->fr.subclass.format, AST_FORMAT_SLINEAR, 0);
 	AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, p->buflen);
 	s->fr.mallocd = 0;
 	s->fr.samples = delay;
@@ -293,10 +293,9 @@
 	return NULL;
 }
 
-static const struct ast_format mp3_f = {
+static struct ast_format_def mp3_f = {
 	.name = "mp3",
 	.exts = "mp3",
-	.format = AST_FORMAT_SLINEAR,
 	.open = mp3_open,
 	.write = mp3_write,
 	.rewrite = mp3_rewrite,
@@ -313,13 +312,14 @@
 
 static int load_module(void)
 {
+	ast_format_set(&mp3_f.format, AST_FORMAT_SLINEAR, 0);
 	InitMP3Constants();
-	return ast_format_register(&mp3_f);
+	return ast_format_def_register(&mp3_f);
 }
 
 static int unload_module(void)
 {
-	return ast_format_unregister(name);
+	return ast_format_def_unregister(name);
 }	
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MP3 format [Any rate but 8000hz mono is optimal]");




More information about the svn-commits mailing list