Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
77720949
Commit
77720949
authored
Mar 06, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mux: kill srand() use
parent
275a5d4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+7
-5
modules/mux/ogg.c
modules/mux/ogg.c
+5
-2
No files found.
modules/mux/mpeg/ts.c
View file @
77720949
...
...
@@ -39,6 +39,7 @@
#include <vlc_sout.h>
#include <vlc_codecs.h>
#include <vlc_block.h>
#include <vlc_rand.h>
#include <vlc_iso_lang.h>
...
...
@@ -520,7 +521,6 @@ static int Open( vlc_object_t *p_this )
p_mux
->
pf_mux
=
Mux
;
p_mux
->
p_sys
=
p_sys
;
srand
(
(
uint32_t
)
mdate
()
);
for
(
i
=
0
;
i
<
MAX_PMT
;
i
++
)
p_sys
->
sdt_descriptors
[
i
].
psz_service_name
=
p_sys
->
sdt_descriptors
[
i
].
psz_provider
=
NULL
;
...
...
@@ -582,7 +582,9 @@ static int Open( vlc_object_t *p_this )
}
free
(
val
.
psz_string
);
p_sys
->
i_pat_version_number
=
rand
()
%
32
;
unsigned
short
subi
[
3
];
vlc_rand_bytes
(
subi
,
sizeof
(
subi
));
p_sys
->
i_pat_version_number
=
nrand48
(
subi
)
&
0x1f
;
p_sys
->
pat
.
i_pid
=
0
;
p_sys
->
pat
.
i_continuity_counter
=
0
;
p_sys
->
pat
.
b_discontinuity
=
false
;
...
...
@@ -591,16 +593,16 @@ static int Open( vlc_object_t *p_this )
if
(
val
.
i_int
)
p_sys
->
i_tsid
=
val
.
i_int
;
else
p_sys
->
i_tsid
=
rand
()
%
65536
;
p_sys
->
i_tsid
=
nrand48
(
subi
)
&
0xffff
;
p_sys
->
i_netid
=
rand
()
%
65536
;
p_sys
->
i_netid
=
nrand48
(
subi
)
&
0xffff
;
#ifdef HAVE_DVBPSI_SDT
var_Get
(
p_mux
,
SOUT_CFG_PREFIX
"netid"
,
&
val
);
if
(
val
.
i_int
)
p_sys
->
i_netid
=
val
.
i_int
;
#endif
p_sys
->
i_pmt_version_number
=
rand
()
%
32
;
p_sys
->
i_pmt_version_number
=
nrand48
(
subi
)
&
0x1f
;
for
(
i
=
0
;
i
<
p_sys
->
i_num_pmt
;
i
++
)
{
p_sys
->
pmt
[
i
].
i_continuity_counter
=
0
;
...
...
modules/mux/ogg.c
View file @
77720949
...
...
@@ -35,6 +35,8 @@
#include <vlc_sout.h>
#include <vlc_block.h>
#include <vlc_codecs.h>
#include <limits.h>
#include <vlc_rand.h>
#include "../demux/xiph.h"
#include <ogg/ogg.h>
...
...
@@ -198,8 +200,9 @@ static int Open( vlc_object_t *p_this )
/* First serial number is random.
* (Done like this because on win32 you need to seed the random number
* generator once per thread). */
srand
(
(
unsigned
int
)
time
(
NULL
)
);
p_sys
->
i_next_serial_no
=
rand
();
uint32_t
r
;
vlc_rand_bytes
(
&
r
,
sizeof
(
r
));
p_sys
->
i_next_serial_no
=
r
&
INT_MAX
;
return
VLC_SUCCESS
;
}
...
...
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