Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
13e85323
提交
13e85323
authored
8月 05, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Hopefully all the spandsp functions now use custom allocation routines
上级
799402dd
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
32 行增加
和
28 行删除
+32
-28
t30.c
libs/spandsp/src/t30.c
+20
-19
t4_rx.c
libs/spandsp/src/t4_rx.c
+2
-1
t4_tx.c
libs/spandsp/src/t4_tx.c
+7
-6
v17rx.c
libs/spandsp/src/v17rx.c
+3
-2
没有找到文件。
libs/spandsp/src/t30.c
浏览文件 @
13e85323
...
...
@@ -45,6 +45,7 @@
#include <tiffio.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/queue.h"
...
...
@@ -636,89 +637,89 @@ static void release_resources(t30_state_t *s)
{
if
(
s
->
tx_info
.
nsf
)
{
free
(
s
->
tx_info
.
nsf
);
span_
free
(
s
->
tx_info
.
nsf
);
s
->
tx_info
.
nsf
=
NULL
;
}
s
->
tx_info
.
nsf_len
=
0
;
if
(
s
->
tx_info
.
nsc
)
{
free
(
s
->
tx_info
.
nsc
);
span_
free
(
s
->
tx_info
.
nsc
);
s
->
tx_info
.
nsc
=
NULL
;
}
s
->
tx_info
.
nsc_len
=
0
;
if
(
s
->
tx_info
.
nss
)
{
free
(
s
->
tx_info
.
nss
);
span_
free
(
s
->
tx_info
.
nss
);
s
->
tx_info
.
nss
=
NULL
;
}
s
->
tx_info
.
nss_len
=
0
;
if
(
s
->
tx_info
.
tsa
)
{
free
(
s
->
tx_info
.
tsa
);
span_
free
(
s
->
tx_info
.
tsa
);
s
->
tx_info
.
tsa
=
NULL
;
}
if
(
s
->
tx_info
.
ira
)
{
free
(
s
->
tx_info
.
ira
);
span_
free
(
s
->
tx_info
.
ira
);
s
->
tx_info
.
ira
=
NULL
;
}
if
(
s
->
tx_info
.
cia
)
{
free
(
s
->
tx_info
.
cia
);
span_
free
(
s
->
tx_info
.
cia
);
s
->
tx_info
.
cia
=
NULL
;
}
if
(
s
->
tx_info
.
isp
)
{
free
(
s
->
tx_info
.
isp
);
span_
free
(
s
->
tx_info
.
isp
);
s
->
tx_info
.
isp
=
NULL
;
}
if
(
s
->
tx_info
.
csa
)
{
free
(
s
->
tx_info
.
csa
);
span_
free
(
s
->
tx_info
.
csa
);
s
->
tx_info
.
csa
=
NULL
;
}
if
(
s
->
rx_info
.
nsf
)
{
free
(
s
->
rx_info
.
nsf
);
span_
free
(
s
->
rx_info
.
nsf
);
s
->
rx_info
.
nsf
=
NULL
;
}
s
->
rx_info
.
nsf_len
=
0
;
if
(
s
->
rx_info
.
nsc
)
{
free
(
s
->
rx_info
.
nsc
);
span_
free
(
s
->
rx_info
.
nsc
);
s
->
rx_info
.
nsc
=
NULL
;
}
s
->
rx_info
.
nsc_len
=
0
;
if
(
s
->
rx_info
.
nss
)
{
free
(
s
->
rx_info
.
nss
);
span_
free
(
s
->
rx_info
.
nss
);
s
->
rx_info
.
nss
=
NULL
;
}
s
->
rx_info
.
nss_len
=
0
;
if
(
s
->
rx_info
.
tsa
)
{
free
(
s
->
rx_info
.
tsa
);
span_
free
(
s
->
rx_info
.
tsa
);
s
->
rx_info
.
tsa
=
NULL
;
}
if
(
s
->
rx_info
.
ira
)
{
free
(
s
->
rx_info
.
ira
);
span_
free
(
s
->
rx_info
.
ira
);
s
->
rx_info
.
ira
=
NULL
;
}
if
(
s
->
rx_info
.
cia
)
{
free
(
s
->
rx_info
.
cia
);
span_
free
(
s
->
rx_info
.
cia
);
s
->
rx_info
.
cia
=
NULL
;
}
if
(
s
->
rx_info
.
isp
)
{
free
(
s
->
rx_info
.
isp
);
span_
free
(
s
->
rx_info
.
isp
);
s
->
rx_info
.
isp
=
NULL
;
}
if
(
s
->
rx_info
.
csa
)
{
free
(
s
->
rx_info
.
csa
);
span_
free
(
s
->
rx_info
.
csa
);
s
->
rx_info
.
csa
=
NULL
;
}
}
...
...
@@ -5829,7 +5830,7 @@ static int decode_nsf_nss_nsc(t30_state_t *s, uint8_t *msg[], const uint8_t *pkt
{
uint8_t
*
t
;
if
((
t
=
m
alloc
(
len
-
1
))
==
NULL
)
if
((
t
=
span_
alloc
(
len
-
1
))
==
NULL
)
return
0
;
memcpy
(
t
,
pkt
+
1
,
len
-
1
);
*
msg
=
t
;
...
...
@@ -6795,7 +6796,7 @@ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s,
{
if
(
s
==
NULL
)
{
if
((
s
=
(
t30_state_t
*
)
m
alloc
(
sizeof
(
*
s
)))
==
NULL
)
if
((
s
=
(
t30_state_t
*
)
span_
alloc
(
sizeof
(
*
s
)))
==
NULL
)
return
NULL
;
}
memset
(
s
,
0
,
sizeof
(
*
s
));
...
...
@@ -6845,7 +6846,7 @@ SPAN_DECLARE(int) t30_release(t30_state_t *s)
SPAN_DECLARE
(
int
)
t30_free
(
t30_state_t
*
s
)
{
t30_release
(
s
);
free
(
s
);
span_
free
(
s
);
return
0
;
}
/*- End of function --------------------------------------------------------*/
...
...
libs/spandsp/src/t4_rx.c
浏览文件 @
13e85323
...
...
@@ -48,6 +48,7 @@
#include <tiffio.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/async.h"
...
...
@@ -1121,7 +1122,7 @@ SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int
allocated
=
FALSE
;
if
(
s
==
NULL
)
{
if
((
s
=
(
t4_rx_state_t
*
)
m
alloc
(
sizeof
(
*
s
)))
==
NULL
)
if
((
s
=
(
t4_rx_state_t
*
)
span_
alloc
(
sizeof
(
*
s
)))
==
NULL
)
return
NULL
;
allocated
=
TRUE
;
}
...
...
libs/spandsp/src/t4_tx.c
浏览文件 @
13e85323
...
...
@@ -48,6 +48,7 @@
#include <tiffio.h>
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/async.h"
...
...
@@ -621,7 +622,7 @@ static int read_tiff_t85_image(t4_tx_state_t *s)
if
(
len
>
biggest
)
biggest
=
len
;
}
if
((
raw_data
=
m
alloc
(
biggest
))
==
NULL
)
if
((
raw_data
=
span_
alloc
(
biggest
))
==
NULL
)
return
-
1
;
s
->
tiff
.
image_size
=
s
->
tiff
.
image_length
*
((
s
->
tiff
.
image_width
+
7
)
/
8
);
...
...
@@ -685,7 +686,7 @@ static int read_tiff_t43_image(t4_tx_state_t *s, uint8_t **buf)
total_image_len
=
0
;
for
(
i
=
0
;
i
<
num_strips
;
i
++
)
total_image_len
+=
TIFFRawStripSize
(
s
->
tiff
.
tiff_file
,
i
);
if
((
raw_data
=
m
alloc
(
total_image_len
))
==
NULL
)
if
((
raw_data
=
span_
alloc
(
total_image_len
))
==
NULL
)
return
-
1
;
total_len
=
0
;
...
...
@@ -704,7 +705,7 @@ static int read_tiff_t43_image(t4_tx_state_t *s, uint8_t **buf)
span_log_set_level
(
logging
,
SPAN_LOG_SHOW_SEVERITY
|
SPAN_LOG_SHOW_PROTOCOL
|
SPAN_LOG_FLOW
);
image_size
=
3
*
s
->
metadata
.
image_length
*
s
->
metadata
.
image_width
;
if
((
*
buf
=
m
alloc
(
image_size
))
==
NULL
)
if
((
*
buf
=
span_
alloc
(
image_size
))
==
NULL
)
return
-
1
;
pack
.
buf
=
*
buf
;
...
...
@@ -751,7 +752,7 @@ static int read_tiff_t42_t81_image(t4_tx_state_t *s)
for (i = 0; i < num_strips; i++)
total_image_len += TIFFRawStripSize(s->tiff.tiff_file, i);
if ((raw_data =
m
alloc(total_image_len)) == NULL)
if ((raw_data =
span_
alloc(total_image_len)) == NULL)
return -1;
total_len = 0;
...
...
@@ -985,7 +986,7 @@ static int make_header(t4_tx_state_t *s)
if
(
s
->
header_text
==
NULL
)
{
if
((
s
->
header_text
=
m
alloc
(
132
+
1
))
==
NULL
)
if
((
s
->
header_text
=
span_
alloc
(
132
+
1
))
==
NULL
)
return
-
1
;
}
/* This is very English oriented, but then most FAX machines are, too. Some
...
...
@@ -1604,7 +1605,7 @@ SPAN_DECLARE(t4_tx_state_t *) t4_tx_init(t4_tx_state_t *s, const char *file, int
allocated
=
FALSE
;
if
(
s
==
NULL
)
{
if
((
s
=
(
t4_tx_state_t
*
)
m
alloc
(
sizeof
(
*
s
)))
==
NULL
)
if
((
s
=
(
t4_tx_state_t
*
)
span_
alloc
(
sizeof
(
*
s
)))
==
NULL
)
return
NULL
;
allocated
=
TRUE
;
}
...
...
libs/spandsp/src/v17rx.c
浏览文件 @
13e85323
...
...
@@ -43,6 +43,7 @@
#include "floating_fudge.h"
#include "spandsp/telephony.h"
#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/fast_convert.h"
#include "spandsp/math_fixed.h"
...
...
@@ -1526,7 +1527,7 @@ SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_
}
if
(
s
==
NULL
)
{
if
((
s
=
(
v17_rx_state_t
*
)
m
alloc
(
sizeof
(
*
s
)))
==
NULL
)
if
((
s
=
(
v17_rx_state_t
*
)
span_
alloc
(
sizeof
(
*
s
)))
==
NULL
)
return
NULL
;
}
memset
(
s
,
0
,
sizeof
(
*
s
));
...
...
@@ -1551,7 +1552,7 @@ SPAN_DECLARE(int) v17_rx_release(v17_rx_state_t *s)
SPAN_DECLARE
(
int
)
v17_rx_free
(
v17_rx_state_t
*
s
)
{
free
(
s
);
span_
free
(
s
);
return
0
;
}
/*- End of function --------------------------------------------------------*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论