We were always picking the same values. This is pretty bad as it breaks
fast resynchronization (and is totally lame anyway).
#include <vlc_network.h>
#include <vlc_charset.h>
#include <vlc_strings.h>
+#include <vlc_rand.h>
#include <srtp.h>
#include "rtp.h"
id->p_stream = p_stream;
- id->i_sequence = rand()&0xffff;
/* Look for free dymanic payload type */
id->i_payload_type = 96;
while (p_sys->payload_bitmap & (1 << (id->i_payload_type - 96)))
id->i_payload_type++;
assert (id->i_payload_type < 128);
- id->ssrc[0] = rand()&0xff;
- id->ssrc[1] = rand()&0xff;
- id->ssrc[2] = rand()&0xff;
- id->ssrc[3] = rand()&0xff;
+ vlc_rand_bytes (&id->i_sequence, sizeof (id->i_sequence));
+ vlc_rand_bytes (id->ssrc, sizeof (id->ssrc));
id->psz_enc = NULL;
id->psz_fmtp = NULL;