]> git.sesse.net Git - vlc/blobdiff - modules/access/mms/asf.c
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / access / mms / asf.c
index bde6239ffcdc606afd5703b85d7b04735c15e6b3..cc7138fcd1306f308d6da49f3b38c239cb098efb 100644 (file)
@@ -25,7 +25,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_rand.h>
 
 #include "asf.h"
 #include "buffer.h"
@@ -45,23 +46,15 @@ static int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 )
               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;
@@ -201,7 +194,7 @@ void E_( asf_HeaderParse )( asf_header_t *hdr,
     }
 }
 
-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 )
 {