Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mediastreamer2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
mediastreamer2
Commits
ab0e9b39
Commit
ab0e9b39
authored
Sep 16, 2014
by
Simon Morlat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use ortp_random() that correctly wraps random function on all os.
parent
4ca3bf8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
vp8.c
src/videofilters/vp8.c
+2
-2
ice.c
src/voip/ice.c
+4
-4
No files found.
src/videofilters/vp8.c
View file @
ab0e9b39
...
@@ -122,9 +122,9 @@ static void enc_init(MSFilter *f) {
...
@@ -122,9 +122,9 @@ static void enc_init(MSFilter *f) {
s
->
frame_count
=
0
;
s
->
frame_count
=
0
;
s
->
last_fir_seq_nr
=
-
1
;
s
->
last_fir_seq_nr
=
-
1
;
#ifdef PICTURE_ID_ON_16_BITS
#ifdef PICTURE_ID_ON_16_BITS
s
->
picture_id
=
(
random
()
&
0x7FFF
)
|
0x8000
;
s
->
picture_id
=
(
ortp_
random
()
&
0x7FFF
)
|
0x8000
;
#else
#else
s
->
picture_id
=
random
()
&
0x007F
;
s
->
picture_id
=
ortp_
random
()
&
0x007F
;
#endif
#endif
s
->
avpf_enabled
=
FALSE
;
s
->
avpf_enabled
=
FALSE
;
...
...
src/voip/ice.c
View file @
ab0e9b39
...
@@ -183,13 +183,13 @@ static const char * const candidate_pair_state_values[] = {
...
@@ -183,13 +183,13 @@ static const char * const candidate_pair_state_values[] = {
static
uint64_t
generate_tie_breaker
(
void
)
static
uint64_t
generate_tie_breaker
(
void
)
{
{
return
(((
uint64_t
)
random
())
<<
32
)
|
(((
uint64_t
)
random
())
&
0xffffffff
);
return
(((
uint64_t
)
ortp_random
())
<<
32
)
|
(((
uint64_t
)
ortp_
random
())
&
0xffffffff
);
}
}
static
char
*
generate_ufrag
(
void
)
static
char
*
generate_ufrag
(
void
)
{
{
char
*
ufrag
=
ms_malloc
(
9
);
char
*
ufrag
=
ms_malloc
(
9
);
sprintf
(
ufrag
,
"%08x"
,
(
int
)
random
());
sprintf
(
ufrag
,
"%08x"
,
(
int
)
ortp_
random
());
ufrag
[
8
]
=
'\0'
;
ufrag
[
8
]
=
'\0'
;
return
ufrag
;
return
ufrag
;
}
}
...
@@ -197,7 +197,7 @@ static char * generate_ufrag(void)
...
@@ -197,7 +197,7 @@ static char * generate_ufrag(void)
static
char
*
generate_pwd
(
void
)
static
char
*
generate_pwd
(
void
)
{
{
char
*
pwd
=
ms_malloc
(
25
);
char
*
pwd
=
ms_malloc
(
25
);
sprintf
(
pwd
,
"%08x%08x%08x"
,
(
int
)
random
(),
(
int
)
random
(),
(
int
)
random
());
sprintf
(
pwd
,
"%08x%08x%08x"
,
(
int
)
ortp_random
(),
(
int
)
ortp_random
(),
(
int
)
ortp_
random
());
pwd
[
24
]
=
'\0'
;
pwd
[
24
]
=
'\0'
;
return
pwd
;
return
pwd
;
}
}
...
@@ -1508,7 +1508,7 @@ static void ice_generate_arbitrary_foundation(char *foundation, int len, MSList
...
@@ -1508,7 +1508,7 @@ static void ice_generate_arbitrary_foundation(char *foundation, int len, MSList
MSList
*
elem
;
MSList
*
elem
;
do
{
do
{
r
=
(((
uint64_t
)
random
())
<<
32
)
|
(((
uint64_t
)
random
())
&
0xffffffff
);
r
=
(((
uint64_t
)
ortp_random
())
<<
32
)
|
(((
uint64_t
)
ortp_
random
())
&
0xffffffff
);
snprintf
(
foundation
,
len
,
"%"
PRIx64
,
r
);
snprintf
(
foundation
,
len
,
"%"
PRIx64
,
r
);
elem
=
ms_list_find_custom
(
list
,
(
MSCompareFunc
)
ice_find_candidate_from_foundation
,
foundation
);
elem
=
ms_list_find_custom
(
list
,
(
MSCompareFunc
)
ice_find_candidate_from_foundation
,
foundation
);
}
while
(
elem
!=
NULL
);
}
while
(
elem
!=
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment