[asterisk-commits] file: branch file/media_formats-apps r408875 - in /team/file/media_formats-ap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 25 06:36:25 CST 2014


Author: file
Date: Tue Feb 25 06:32:48 2014
New Revision: 408875

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408875
Log:
Incorporate review feedback.

Modified:
    team/file/media_formats-apps/codecs/ex_adpcm.h
    team/file/media_formats-apps/codecs/ex_alaw.h
    team/file/media_formats-apps/include/asterisk/channel.h
    team/file/media_formats-apps/include/asterisk/mod_format.h
    team/file/media_formats-apps/main/format_cap.c

Modified: team/file/media_formats-apps/codecs/ex_adpcm.h
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-apps/codecs/ex_adpcm.h?view=diff&rev=408875&r1=408874&r2=408875
==============================================================================
--- team/file/media_formats-apps/codecs/ex_adpcm.h (original)
+++ team/file/media_formats-apps/codecs/ex_adpcm.h Tue Feb 25 06:32:48 2014
@@ -27,7 +27,7 @@
 		.data.ptr = ex_adpcm,
 	};
 
-	f.subclass.format = ast_format_adpcm;
+	f.subclass.format = ast_format_copy(ast_format_adpcm);
 
 	return &f;
 }

Modified: team/file/media_formats-apps/codecs/ex_alaw.h
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-apps/codecs/ex_alaw.h?view=diff&rev=408875&r1=408874&r2=408875
==============================================================================
--- team/file/media_formats-apps/codecs/ex_alaw.h (original)
+++ team/file/media_formats-apps/codecs/ex_alaw.h Tue Feb 25 06:32:48 2014
@@ -31,6 +31,6 @@
 		.src = __PRETTY_FUNCTION__,
 		.data.ptr = ex_alaw,
 	};
-	f.subclass.format = ast_format_ulaw;
+	f.subclass.format = ast_format_copy(ast_format_ulaw);
 	return &f;
 }

Modified: team/file/media_formats-apps/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-apps/include/asterisk/channel.h?view=diff&rev=408875&r1=408874&r2=408875
==============================================================================
--- team/file/media_formats-apps/include/asterisk/channel.h (original)
+++ team/file/media_formats-apps/include/asterisk/channel.h Tue Feb 25 06:32:48 2014
@@ -3931,7 +3931,7 @@
 struct ast_format *ast_channel_readformat(struct ast_channel *chan);
 struct ast_format *ast_channel_writeformat(struct ast_channel *chan);
 
-/* Format setters */
+/* Format setters - all of these functions will increment the reference count of the format passed in */
 void ast_channel_set_oldwriteformat(struct ast_channel *chan, struct ast_format *format);
 void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format);
 void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format);

Modified: team/file/media_formats-apps/include/asterisk/mod_format.h
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-apps/include/asterisk/mod_format.h?view=diff&rev=408875&r1=408874&r2=408875
==============================================================================
--- team/file/media_formats-apps/include/asterisk/mod_format.h (original)
+++ team/file/media_formats-apps/include/asterisk/mod_format.h Tue Feb 25 06:32:48 2014
@@ -43,10 +43,10 @@
 struct ast_format_def {
 	char name[80];		/*!< Name of format */
 	char exts[80];		/*!< Extensions (separated by | if more than one) 
-	    			this format can read.  First is assumed for writing (e.g. .mp3) */
+						 * this format can read.  First is assumed for writing (e.g. .mp3) */
 	struct ast_format *format;	/*!< Format of frames it uses/provides (one only) */
-	/*! 
-	 * \brief Prepare an input stream for playback. 
+	/*!
+	 * \brief Prepare an input stream for playback.
 	 * \return 0 on success, -1 on error.
 	 * The FILE is already open (in s->f) so this function only needs to perform
 	 * any applicable validity checks on the file. If none is required, the

Modified: team/file/media_formats-apps/main/format_cap.c
URL: http://svnview.digium.com/svn/asterisk/team/file/media_formats-apps/main/format_cap.c?view=diff&rev=408875&r1=408874&r2=408875
==============================================================================
--- team/file/media_formats-apps/main/format_cap.c (original)
+++ team/file/media_formats-apps/main/format_cap.c Tue Feb 25 06:32:48 2014
@@ -494,8 +494,7 @@
 		if ((psize = strrchr(this, ':'))) {
 			*psize++ = '\0';
 			ast_debug(1, "Packetization for codec: %s is %s\n", this, psize);
-			framems = atoi(psize);
-			if (framems < 0) {
+			if (!sscanf(psize, "%30d", &framems) || (framems < 0)) {
 				framems = 0;
 				errors++;
 				ast_log(LOG_WARNING, "Bad packetization value for codec %s\n", this);




More information about the asterisk-commits mailing list