# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_rand.h>
#include "asf.h"
#include "buffer.h"
p_guid1->v4[7] == p_guid2->v4[7] ) ? 1 : 0 );
}
-void E_( GenerateGuid )( guid_t *p_guid )
+void GenerateGuid ( guid_t *p_guid )
{
- int i;
-
- srand( mdate() & 0xffffffff );
-
- /* FIXME should be generated using random data */
p_guid->v1 = 0xbabac001;
- p_guid->v2 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
- p_guid->v3 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
- for( i = 0; i < 8; i++ )
- {
- p_guid->v4[i] = ( (uint64_t)rand() * 256 ) / RAND_MAX;
- }
+ vlc_rand_bytes(&p_guid->v2, sizeof(p_guid->v2));
+ vlc_rand_bytes(&p_guid->v3, sizeof(p_guid->v3));
+ vlc_rand_bytes(p_guid->v4, sizeof(p_guid->v4));
}
-void E_( asf_HeaderParse )( asf_header_t *hdr,
+void asf_HeaderParse ( asf_header_t *hdr,
uint8_t *p_header, int i_header )
{
var_buffer_t buffer;
}
}
-void E_( asf_StreamSelect ) ( asf_header_t *hdr,
+void asf_StreamSelect ( asf_header_t *hdr,
int i_bitrate_max,
bool b_all, bool b_audio, bool b_video )
{