[asterisk-commits] mnicholson: branch 1.6.0 r231744 - in /branches/1.6.0: ./ main/file.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Dec 1 09:51:35 CST 2009
Author: mnicholson
Date: Tue Dec 1 09:51:33 2009
New Revision: 231744
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=231744
Log:
Merged revisions 231741 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r231741 | mnicholson | 2009-12-01 09:47:36 -0600 (Tue, 01 Dec 2009) | 9 lines
Merged revisions 231740 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r231740 | mnicholson | 2009-12-01 09:34:57 -0600 (Tue, 01 Dec 2009) | 2 lines
Ignore unknown formats in ast_format_str_reduce() and return an error if no know formats are found.
........
................
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/main/file.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/main/file.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/main/file.c?view=diff&rev=231744&r1=231743&r2=231744
==============================================================================
--- branches/1.6.0/main/file.c (original)
+++ branches/1.6.0/main/file.c Tue Dec 1 09:51:33 2009
@@ -1342,7 +1342,7 @@
char *fmts_str[AST_MAX_FORMATS];
char *stringp, *type;
char *orig = fmts;
- int i, j, x, found;
+ int i, j, x, first, found;
int len = strlen(fmts) + 1;
if (AST_RWLIST_RDLOCK(&formats)) {
@@ -1369,11 +1369,19 @@
}
AST_RWLIST_UNLOCK(&formats);
+ first = 1;
for (i = 0; i < x; i++) {
+ /* ignore invalid entries */
+ if (!fmts_ptr[i]) {
+ ast_log(LOG_WARNING, "ignoring unknown format '%s'\n", fmts_str[i]);
+ continue;
+ }
+
/* special handling for the first entry */
- if (i == 0) {
+ if (first) {
fmts += snprintf(fmts, len, "%s", fmts_str[i]);
len -= (fmts - orig);
+ first = 0;
continue;
}
@@ -1390,6 +1398,11 @@
fmts += snprintf(fmts, len, "|%s", fmts_str[i]);
len -= (fmts - orig);
}
+ }
+
+ if (first) {
+ ast_log(LOG_WARNING, "no known formats found in format list (%s)\n", orig);
+ return NULL;
}
return orig;
More information about the asterisk-commits
mailing list