]> git.sesse.net Git - vlc/commitdiff
* ALL: portability fixes.
authorGildas Bazin <gbazin@videolan.org>
Tue, 17 Feb 2004 13:13:32 +0000 (13:13 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 17 Feb 2004 13:13:32 +0000 (13:13 +0000)
modules/access/directory.c
modules/demux/a52.c
modules/demux/dts.c
modules/demux/mp4/drms.c
modules/mux/mpeg/ts.c

index a6dfb08019de6f9a6f3942cdaef7d5e124aaf2e7..aad29891c5c75bcf841d356c54ae05be2da4da32 100644 (file)
@@ -2,7 +2,7 @@
  * directory.c: expands a directory (directory: access plug-in)
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: directory.c,v 1.5 2004/02/16 17:16:24 zorglub Exp $
+ * $Id: directory.c,v 1.6 2004/02/17 13:13:31 gbazin Exp $
  *
  * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
  *
@@ -101,7 +101,7 @@ vlc_module_begin();
     add_shortcut( "dir" );
     add_string( "recursive", "expand" , NULL, RECURSIVE_TEXT,
                 RECURSIVE_LONGTEXT, VLC_FALSE );
-    //change_string_list( psz_recursive_list, psz_recursive_list_text, 0 );
+      change_string_list( psz_recursive_list, psz_recursive_list_text, 0 );
     set_callbacks( Open, Close );
 vlc_module_end();
 
@@ -293,7 +293,15 @@ int ReadDir( input_thread_t *p_input, char *psz_name , int i_mode )
             strcmp( p_dir_content->d_name, ".." ) &&
             p_access_data->i_pos + i_size_entry < MAX_DIR_SIZE )
         {
+#if defined( DT_DIR )
             if( p_dir_content->d_type == DT_DIR )
+#elif defined( S_ISDIR )
+            struct stat stat_data;
+            stat( psz_entry, &stat_data );
+            if( S_ISDIR(stat_data.st_mode) )
+#else
+            if( 0 )
+#endif
             {
                 if( i_mode == MODE_NONE )
                 {
index eef804d0232c54af2fa7b996be14d316d15288b7..b0bae276b6fb4c9d67b5d00307c22994be4f1151 100644 (file)
@@ -2,7 +2,7 @@
  * a52.c : raw A/52 stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.4 2004/02/13 22:37:35 gbazin Exp $
+ * $Id: a52.c,v 1.5 2004/02/17 13:13:32 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -70,7 +70,7 @@ vlc_module_end();
 /*****************************************************************************
  * CheckSync: Check if buffer starts with an A52 sync code
  *****************************************************************************/
-int CheckSync( uint8_t *p_peek, vlc_bool_t *p_big_endian )
+static int CheckSync( uint8_t *p_peek, vlc_bool_t *p_big_endian )
 {
     /* Little endian version of the bitstream */
     if( p_peek[0] == 0x77 && p_peek[1] == 0x0b &&
index 725365e6a0f05913a07147e94f5575663edc277a..b618e8d3eec0f8463c7803a70d1c18ef6c6094be 100644 (file)
@@ -2,7 +2,7 @@
  * dts.c : raw DTS stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: dts.c,v 1.7 2004/02/08 16:48:11 gbazin Exp $
+ * $Id: dts.c,v 1.8 2004/02/17 13:13:32 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -64,7 +64,7 @@ vlc_module_end();
 /*****************************************************************************
  * CheckSync: Check if buffer starts with a DTS sync code
  *****************************************************************************/
-int CheckSync( uint8_t *p_peek )
+static int CheckSync( uint8_t *p_peek )
 {
     /* 14 bits, little endian version of the bitstream */
     if( p_peek[0] == 0xff && p_peek[1] == 0x1f &&
index 30e2a07e158c3da66a48a8ec6e008f15c79f42e5..59658e3f965260c73f065395695384be75cb2f48 100644 (file)
@@ -2,7 +2,7 @@
  * drms.c: DRMS
  *****************************************************************************
  * Copyright (C) 2004 VideoLAN
- * $Id: drms.c,v 1.12 2004/01/26 17:15:40 jlj Exp $
+ * $Id: drms.c,v 1.13 2004/02/17 13:13:31 gbazin Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Sam Hocevar <sam@zoy.org>
@@ -145,7 +145,7 @@ static int GetUserKey     ( void *, uint32_t * );
 
 static int GetSCIData     ( char *, uint32_t **, uint32_t * );
 static int HashSystemInfo ( uint32_t * );
-static int GetiPodID      ( long long * );
+static int GetiPodID      ( int64_t * );
 
 #ifdef WORDS_BIGENDIAN
 /*****************************************************************************
@@ -756,7 +756,7 @@ static int GetSystemKey( uint32_t *p_sys_key, vlc_bool_t b_ipod )
     static char const p_secret1[ 8 ] = "YuaFlafu";
     static char const p_secret2[ 8 ] = "zPif98ga";
     struct md5_s md5;
-    long long i_ipod_id;
+    int64_t i_ipod_id;
     uint32_t p_system_hash[ 4 ];
 
     /* Compute the MD5 hash of our system info */
@@ -1116,8 +1116,6 @@ static int HashSystemInfo( uint32_t *p_system_hash )
     struct md5_s md5;
     int i_ret = 0;
 
-    InitMD5( &md5 );
-
 #ifdef WIN32
     HKEY i_key;
     unsigned int i;
@@ -1143,6 +1141,8 @@ static int HashSystemInfo( uint32_t *p_system_hash )
         }
     };
 
+    InitMD5( &md5 );
+
     AddMD5( &md5, "cache-control", 13 );
     AddMD5( &md5, "Ethernet", 8 );
 
@@ -1183,6 +1183,7 @@ static int HashSystemInfo( uint32_t *p_system_hash )
     }
 
 #else
+    InitMD5( &md5 );
     i_ret = -1;
 #endif
 
@@ -1197,7 +1198,7 @@ static int HashSystemInfo( uint32_t *p_system_hash )
  *****************************************************************************
  * This function gets the iPod ID.
  *****************************************************************************/
-static int GetiPodID( long long *p_ipod_id )
+static int GetiPodID( int64_t *p_ipod_id )
 {
     int i_ret = -1;
 
@@ -1241,7 +1242,7 @@ static int GetiPodID( long long *p_ipod_id )
                     {
                         if( CFGetTypeID( value ) == CFNumberGetTypeID() )
                         {
-                            long long i_ipod_id;
+                            int64_t i_ipod_id;
                             CFNumberGetValue( (CFNumberRef)value,
                                               kCFNumberLongLongType,
                                               &i_ipod_id );
index 8da1078b09c025508188702c91a3284c88f3c34e..da65c8dd084ae31183168c6a6d9363415b1d2368 100644 (file)
@@ -2,7 +2,7 @@
  * ts.c: MPEG-II TS Muxer
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: ts.c,v 1.43 2004/01/30 17:53:05 fenrir Exp $
+ * $Id: ts.c,v 1.44 2004/02/17 13:13:31 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -389,9 +389,16 @@ static int Open( vlc_object_t *p_this )
         }
         else
         {
-            uint64_t i_ck = strtoll( val, NULL, 16 );
-            uint8_t ck[8];
-            int     i;
+            /* Avoid using strtoll */
+            uint64_t i_ck;
+            uint8_t  ck[8];
+            int      i;
+
+            ck[0] = val[8];
+            val[8] = 0;
+            i_ck = strtol( val, NULL, 16 ) << 32;
+            val[8] = ck[0];
+            i_ck += strtol( &val[8], NULL, 16 );
             for( i = 0; i < 8; i++ )
             {
                 ck[i] = ( i_ck >> ( 56 - 8*i) )&0xff;