]> git.sesse.net Git - vlc/commitdiff
Most of demux/
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 12 Sep 2006 19:15:20 +0000 (19:15 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 12 Sep 2006 19:15:20 +0000 (19:15 +0000)
modules/demux/asf/libasf.c
modules/demux/mp4/libmp4.c
modules/demux/mp4/mp4.c
modules/demux/nsc.c
modules/demux/playlist/b4s.c
modules/demux/real.c
modules/demux/subtitle.c
modules/demux/ts.c
modules/demux/vobsub.c

index 5c45fb61d45d5988bc03f9bcea506799682d972b..7665e76656c9c3153d27e4b3564a1dfe6455f747 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#include <vlc/vlc.h>
+
+#include <stdio.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 
-#include <vlc/vlc.h>
 #include <vlc/input.h>
 
 #include "codecs.h"                        /* BITMAPINFOHEADER, WAVEFORMATEX */
index 93259431148eb5be35ce04b7fe21e527faca87ae..13d7905f413ffed6cefbde1ec6aea400647e9f1b 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+#include <vlc/vlc.h>
+
+#include <stdio.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 
-#include <vlc/vlc.h>
 #include <vlc/input.h>
 
 #ifdef HAVE_ZLIB_H
@@ -1112,10 +1114,12 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
     {
         /* SoundDescriptionV2 */
         double f_sample_rate;
+       int64_t dummy;
         uint32_t i_channel;
 
         MP4_GET4BYTES( p_box->data.p_sample_soun->i_sample_per_packet );
-        MP4_GET8BYTES( (*(int64_t *)&f_sample_rate) );
+        MP4_GET8BYTES( dummy );
+       memcpy( &f_sample_rate, &dummy, 8 );
 
         msg_Dbg( p_stream, "read box: %f Hz", f_sample_rate );
         p_box->data.p_sample_soun->i_sampleratehi = (int)f_sample_rate % 65536;
index 84300fa357d279201be4bbe3e50134b3085ead02..5a533248ae3b96e019ee4b10fb3512a39f9f9830 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
 
 #include <vlc/vlc.h>
+
+#include <stdio.h>
+#include <stdlib.h>                                      /* malloc(), free() */
+
 #include <vlc/input.h>
 #include <vlc_playlist.h>
 #include <vlc_md5.h>
index 77ff04d6a89e3b7ee4f6219bcd5afb1b89173e66..6bb9b6c4f9ccc3243389b12ec0dbc185b1689644 100644 (file)
@@ -147,7 +147,7 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded )
     vlc_iconv_t conv;
     size_t buf16_size;
     unsigned char *buf16;
-    char *p_buf16;
+    const char *p_buf16;
     size_t buf8_size;
     char *buf8;
     char *p_buf8;
@@ -208,7 +208,7 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded )
     }
 
     buf16_size = length;
-    buf16 = (unsigned char *)malloc( buf16_size );
+    buf16 = malloc( buf16_size );
     if( buf16 == NULL )
     {
         msg_Err( p_demux, "out of memory" );
@@ -220,17 +220,17 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded )
         if( load_byte( encoding_type, &buf16[ i ], &p_input, &j, &k ) )
         {
             msg_Err( p_demux, "load_byte failed" );
-            free( (void *)buf16 );
+            free( buf16 );
             return NULL;
         }
     }
 
     buf8_size = length;
-    buf8 = (char *)malloc( buf8_size + 1 );
+    buf8 = malloc( buf8_size + 1 );
     if( buf8 == NULL )
     {
         msg_Err( p_demux, "out of memory" );
-        free( (void *)buf16 );
+        free( buf16 );
         return NULL;
     }
 
@@ -238,13 +238,13 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded )
     if( conv == (vlc_iconv_t)-1 )
     {
         msg_Err( p_demux, "iconv_open failed" );
-        free( (void *)buf16 );
-        free( (void *)buf8 );
+        free( buf16 );
+        free( buf8 );
         return NULL;
     }
 
-    p_buf8 = &buf8[ 0 ];
-    p_buf16 = (char *)&buf16[ 0 ];
+    p_buf8 = buf8;
+    p_buf16 = (const char *)buf16;
 
     if( vlc_iconv( conv, &p_buf16, &buf16_size, &p_buf8, &buf8_size ) < 0 )
     {
@@ -258,7 +258,7 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded )
 
     vlc_iconv_close( conv );
 
-    free( (void *)buf16 );
+    free( buf16 );
     return buf8;
 }
 
index 591f5ad70bbcea70bd42939b85748359e46a5ae6..45cef697d7381c9f5901d8ad4c8f8b301bf1bb0e 100644 (file)
@@ -45,7 +45,7 @@ struct demux_sys_t
  *****************************************************************************/
 static int Demux( demux_t *p_demux);
 static int Control( demux_t *p_demux, int i_query, va_list args );
-static char *GetNextToken(char *psz_cur_string);
+//static char *GetNextToken(char *psz_cur_string);
 static int IsWhitespace( char *psz_string );
 
 /*****************************************************************************
@@ -298,6 +298,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     return VLC_EGENERIC;
 }
 
+#if 0
 /**
  * Get a in-string pointer to the start of the next token from a
  * string terminating the pointer returned by a previous call.
@@ -318,6 +319,7 @@ static char *GetNextToken(char *psz_cur_string) {
         psz_cur_string++;
     return psz_cur_string;
 }
+#endif
 
 static int IsWhitespace( char *psz_string )
 {
index bafa920bb555afb7fb6586bbc4501378859edd44..e640afdcabd9dc002f2bdbdf8b1beeacb64fa0b9 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#include <vlc/vlc.h>
+
+#include <stdio.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 
-#include <vlc/vlc.h>
 #include <vlc/input.h>
 #include "charset.h"
 
index 4240a31d5ae1a698d33bee4512e3534861e8f4c3..e17acab47b91ae16c7b2c73aad8250d7305779fe 100644 (file)
@@ -25,6 +25,9 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#include <vlc/vlc.h>
+
+#include <string.h>
 #include <stdlib.h>
 
 #include <errno.h>
@@ -33,9 +36,9 @@
 #endif
 #include <ctype.h>
 
-#include <vlc/vlc.h>
 #include <vlc/input.h>
 #include "vlc_video.h"
+#include "charset.h"
 
 /*****************************************************************************
  * Module descriptor
index e5e611f8f650bfe737ef087a392d9a18d53518e7..376c1e102423a3feb568ddc9fbe19c3c026ebdca 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+
+#include <vlc/vlc.h>
+
+#include <stdio.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <ctype.h>
 
-#include <vlc/vlc.h>
 #include <vlc/input.h>
 
 #include "iso_lang.h"
@@ -2403,6 +2406,7 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt )
         {
             if( p_dr->i_tag == 0x48 )
             {
+#if 0
                 static const char *psz_type[0x11] = {
                     "Reserved",
                     "Digital television service",
@@ -2422,6 +2426,7 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt )
                     "RCS FLS (see EN 301 790 [35])",
                     "DVB MHP service"
                 };
+#endif
                 dvbpsi_service_dr_t *pD = dvbpsi_DecodeServiceDr( p_dr );
                 char str1[257];
                 char str2[257];
index 0393b21302d4d4ca11d5683c9617b155c4624718..032e535a2c4e0daaa925d724163fb46bedef2bb9 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#include <vlc/vlc.h>
+
 #include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 #include <sys/types.h>
 
-#include <vlc/vlc.h>
 #include <vlc/input.h>
 #include "vlc_video.h"
 #include "charset.h"