Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
1df93ae9
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1df93ae9
编写于
2月 21, 2007
作者:
A
Alex Beregszaszi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use av_random instead random/srandom
Originally committed as revision 8051 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
d5039327
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
6 deletion
+9
-6
ffserver.c
ffserver.c
+9
-6
未找到文件。
ffserver.c
浏览文件 @
1df93ae9
...
...
@@ -45,6 +45,7 @@
#include "version.h"
#include "ffserver.h"
#include "random.h"
/* maximum number of simultaneous HTTP connections */
#define HTTP_MAX_CONNECTIONS 2000
...
...
@@ -291,6 +292,8 @@ static int current_bandwidth;
static
long
cur_time
;
// Making this global saves on passing it around everywhere
static
AVRandomState
random_state
;
static
long
gettime_ms
(
void
)
{
struct
timeval
tv
;
...
...
@@ -468,8 +471,8 @@ static void start_multicast(void)
for
(
stream
=
first_stream
;
stream
!=
NULL
;
stream
=
stream
->
next
)
{
if
(
stream
->
is_multicast
)
{
/* open the RTP connection */
snprintf
(
session_id
,
sizeof
(
session_id
),
"%08x%08x"
,
(
int
)
random
(),
(
int
)
random
(
));
snprintf
(
session_id
,
sizeof
(
session_id
),
"%08x%08x"
,
av_random
(
&
random_state
),
av_random
(
&
random_state
));
/* choose a port if none given */
if
(
stream
->
multicast_port
==
0
)
{
...
...
@@ -1536,7 +1539,7 @@ static int http_parse_request(HTTPContext *c)
if
(
!
strcmp
(
c
->
stream
->
fmt
->
name
,
"asf_stream"
))
{
/* Need to allocate a client id */
c
->
wmp_client_id
=
random
(
)
&
0x7fffffff
;
c
->
wmp_client_id
=
av_random
(
&
random_state
)
&
0x7fffffff
;
q
+=
snprintf
(
q
,
q
-
(
char
*
)
c
->
buffer
+
c
->
buffer_size
,
"Server: Cougar 4.1.0.3923
\r\n
Cache-Control: no-cache
\r\n
Pragma: client-id=%d
\r\n
Pragma: features=
\"
broadcast
\"\r\n
"
,
c
->
wmp_client_id
);
}
...
...
@@ -2826,8 +2829,8 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
/* generate session id if needed */
if
(
h
->
session_id
[
0
]
==
'\0'
)
{
snprintf
(
h
->
session_id
,
sizeof
(
h
->
session_id
),
"%08x%08x"
,
(
int
)
random
(),
(
int
)
random
(
));
snprintf
(
h
->
session_id
,
sizeof
(
h
->
session_id
),
"%08x%08x"
,
av_random
(
&
random_state
),
av_random
(
&
random_state
));
}
/* find rtp session, and create it if none found */
...
...
@@ -4525,7 +4528,7 @@ int main(int argc, char **argv)
putenv
(
"http_proxy"
);
/* Kill the http_proxy */
srandom
(
gettime_ms
()
+
(
getpid
()
<<
16
)
);
av_init_random
(
gettime_ms
()
+
(
getpid
()
<<
16
),
&
random_state
);
/* address on which the server will handle HTTP connections */
my_http_addr
.
sin_family
=
AF_INET
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录