Formatting fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@31497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Olle Johansson
2006-06-01 19:48:31 +00:00
parent 749d4d959f
commit 0760b8244d

25
frame.c
View File

@@ -18,7 +18,7 @@
/*! \file /*! \file
* *
* \brief Frame manipulation routines * \brief Frame and codec manipulation routines
* *
* \author Mark Spencer <markster@digium.com> * \author Mark Spencer <markster@digium.com>
*/ */
@@ -198,6 +198,7 @@ struct ast_frame *ast_smoother_read(struct ast_smoother *s)
{ {
struct ast_frame *opt; struct ast_frame *opt;
int len; int len;
/* IF we have an optimization frame, send it */ /* IF we have an optimization frame, send it */
if (s->opt) { if (s->opt) {
if (s->opt->offset < AST_FRIENDLY_OFFSET) if (s->opt->offset < AST_FRIENDLY_OFFSET)
@@ -480,6 +481,7 @@ int ast_fr_fdhangup(int fd)
} }
#endif /* unused functions */ #endif /* unused functions */
void ast_swapcopy_samples(void *dst, const void *src, int samples) void ast_swapcopy_samples(void *dst, const void *src, int samples)
{ {
int i; int i;
@@ -515,12 +517,14 @@ char* ast_getformatname(int format)
return ret; return ret;
} }
char *ast_getformatname_multiple(char *buf, size_t size, int format) { char *ast_getformatname_multiple(char *buf, size_t size, int format)
{
int x; int x;
unsigned len; unsigned len;
char *start, *end = buf; char *start, *end = buf;
if (!size) return buf;
if (!size)
return buf;
snprintf(end, size, "0x%x (", format); snprintf(end, size, "0x%x (", format);
len = strlen(end); len = strlen(end);
end += len; end += len;
@@ -544,13 +548,13 @@ char *ast_getformatname_multiple(char *buf, size_t size, int format) {
static struct ast_codec_alias_table { static struct ast_codec_alias_table {
char *alias; char *alias;
char *realname; char *realname;
} ast_codec_alias_table[] = { } ast_codec_alias_table[] = {
{ "slinear", "slin"}, { "slinear", "slin"},
{ "g723.1", "g723"}, { "g723.1", "g723"},
}; };
static const char *ast_expand_codec_alias(const char *in) { static const char *ast_expand_codec_alias(const char *in)
{
int x; int x;
for (x = 0; x < sizeof(ast_codec_alias_table) / sizeof(ast_codec_alias_table[0]); x++) { for (x = 0; x < sizeof(ast_codec_alias_table) / sizeof(ast_codec_alias_table[0]); x++) {
@@ -578,7 +582,8 @@ int ast_getformatbyname(const char *name)
return format; return format;
} }
char *ast_codec2str(int codec) { char *ast_codec2str(int codec)
{
int x; int x;
char *ret = "unknown"; char *ret = "unknown";
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) { for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
@@ -938,7 +943,7 @@ int ast_codec_pref_index(struct ast_codec_pref *pref, int index)
return slot ? AST_FORMAT_LIST[slot-1].bits : 0; return slot ? AST_FORMAT_LIST[slot-1].bits : 0;
} }
/*! \brief ast_codec_pref_remove: Remove codec from pref list */ /*! \brief Remove codec from pref list */
void ast_codec_pref_remove(struct ast_codec_pref *pref, int format) void ast_codec_pref_remove(struct ast_codec_pref *pref, int format)
{ {
struct ast_codec_pref oldorder; struct ast_codec_pref oldorder;
@@ -961,7 +966,7 @@ void ast_codec_pref_remove(struct ast_codec_pref *pref, int format)
} }
/*! \brief ast_codec_pref_append: Append codec to list */ /*! \brief Append codec to list */
int ast_codec_pref_append(struct ast_codec_pref *pref, int format) int ast_codec_pref_append(struct ast_codec_pref *pref, int format)
{ {
int x, newindex = -1; int x, newindex = -1;
@@ -988,7 +993,7 @@ int ast_codec_pref_append(struct ast_codec_pref *pref, int format)
} }
/*! \brief ast_codec_choose: Pick a codec */ /*! \brief Pick a codec */
int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best) int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best)
{ {
int x, ret = 0, slot; int x, ret = 0, slot;