]> git.sesse.net Git - vlc/commitdiff
Added const wheen needed for stream_Peek (demuxer/access)
authorLaurent Aimar <fenrir@videolan.org>
Sun, 30 Sep 2007 15:40:34 +0000 (15:40 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 30 Sep 2007 15:40:34 +0000 (15:40 +0000)
Made demux2_IsPathExtension case insensitive.
Used demux2_IsPathExtension/p_demux->b_force when appropriate
Fixed a regression in flac demuxer (segfault when reading meta data)
Added a VLC_UNUSED(x) macro to avoid seeing ugly (void)x around the code.
Improved a bit a few vlc_common.h macro (do {} while(0))

49 files changed:
include/vlc_common.h
include/vlc_demux.h
modules/access/dvdnav.c
modules/access/dvdread.c
modules/access/fake.c
modules/demux/a52.c
modules/demux/aiff.c
modules/demux/au.c
modules/demux/avi/avi.c
modules/demux/avi/libavi.c
modules/demux/cdg.c
modules/demux/demuxdump.c
modules/demux/dts.c
modules/demux/flac.c
modules/demux/gme.cpp
modules/demux/mjpeg.c
modules/demux/mod.c
modules/demux/mp4/libmp4.c
modules/demux/mpc.c
modules/demux/mpeg/h264.c
modules/demux/mpeg/m4a.c
modules/demux/mpeg/m4v.c
modules/demux/mpeg/mpga.c
modules/demux/mpeg/mpgv.c
modules/demux/nsc.c
modules/demux/nsv.c
modules/demux/nuv.c
modules/demux/ogg.c
modules/demux/playlist/asx.c
modules/demux/playlist/dvb.c
modules/demux/playlist/gvp.c
modules/demux/playlist/ifo.c
modules/demux/playlist/m3u.c
modules/demux/playlist/pls.c
modules/demux/playlist/sgimb.c
modules/demux/playlist/shoutcast.c
modules/demux/ps.c
modules/demux/ps.h
modules/demux/pva.c
modules/demux/rawdv.c
modules/demux/rawvid.c
modules/demux/subtitle.c
modules/demux/ts.c
modules/demux/tta.c
modules/demux/ty.c
modules/demux/vc1.c
modules/demux/xa.c
src/input/meta.c
src/input/var.c

index 2953193036b9650f35acff1a2855fc29ecff642b..923586de31f5fb937857b822abd46d09cb9e64c6 100644 (file)
@@ -668,23 +668,23 @@ static inline uint8_t clip_uint8_vlc( int32_t a )
 }
 
 /* Malloc with automatic error */
-#define MALLOC_VOID( var, type ) { var = (type*)malloc( sizeof( type) ); \
-                                   if( !var ) return; }
-#define MALLOC_NULL( var, type ) { var = (type*)malloc( sizeof( type) ); \
-                                   if( !var ) return NULL; }
-#define MALLOC_ERR( var, type ) { var = (type*)malloc( sizeof( type) ); \
-                                   if( !var ) return VLC_ENOMEM; }
-#define MALLOC_GOTOERR( var, type ) { var = (type*)malloc( sizeof( type) ); \
-                                      if( !var ) goto error; }
+#define MALLOC_VOID( var, type ) do { var = (type*)malloc( sizeof( type) ); \
+                                   if( !var ) return; } while(0)
+#define MALLOC_NULL( var, type ) do { var = (type*)malloc( sizeof( type) ); \
+                                   if( !var ) return NULL; } while(0)
+#define MALLOC_ERR( var, type ) do { var = (type*)malloc( sizeof( type) ); \
+                                   if( !var ) return VLC_ENOMEM; } while(0)
+#define MALLOC_GOTOERR( var, type ) do { var = (type*)malloc( sizeof( type) ); \
+                                      if( !var ) goto error; } while(0)
 #define DECMALLOC_VOID( var, type ) type* var = (type*)malloc( sizeof(type) );\
                                     if( !var ) return;
-#define DECMALLOC_ERR( var, type ) type* var = (type*)malloc( sizeof(type) );\
+#define DECMALLOC_ERR( var, type )  type* var = (type*)malloc( sizeof(type) );\
                                     if( !var ) return VLC_ENOMEM;
 #define DECMALLOC_NULL( var, type ) type* var = (type*)malloc( sizeof(type) );\
                                     if( !var ) return NULL;
 
-#define FREENULL(a) if( a ) { free( a ); a = NULL; }
-#define FREE(a) if( a ) { free( a ); }
+#define FREENULL(a) do { if( a ) { free( a ); a = NULL; } } while(0)
+#define FREE(a) do { if( a ) { free( a ); } } while(0)
 
 #define EMPTY_STR(str) (!str || !*str)
 
@@ -814,6 +814,9 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
 #   define ATTR_ALIGN(align)
 #endif
 
+/* */
+#define VLC_UNUSED(x) (void)(x)
+
 /* Alignment of critical dynamic data structure
  *
  * Not all platforms support memalign so we provide a vlc_memalign wrapper
index b5a834d75631388f90843105e7d808ef9f09241c..6176013fd3997e9f311faeab4a612a4ece2e8617 100644 (file)
@@ -128,7 +128,7 @@ VLC_EXPORT( int,       demux2_vaControlHelper, ( stream_t *, int64_t i_start, in
 static inline vlc_bool_t demux2_IsPathExtension( demux_t *p_demux, const char *psz_extension )
 {
     const char *psz_ext = strrchr ( p_demux->psz_path, '.' );
-    if( !psz_ext || strcmp( psz_ext, psz_extension ) )
+    if( !psz_ext || strcasecmp( psz_ext, psz_extension ) )
         return VLC_FALSE;
     return VLC_TRUE;
 }
@@ -140,24 +140,21 @@ static inline vlc_bool_t demux2_IsForced( demux_t *p_demux, const char *psz_name
     return VLC_TRUE;
 }
 
-#define STANDARD_DEMUX_INIT \
-    p_demux->pf_control = Control; \
-    p_demux->pf_demux = Demux; \
+#define DEMUX_INIT_COMMON() do {            \
+    p_demux->pf_control = Control;          \
+    p_demux->pf_demux = Demux;              \
     MALLOC_ERR( p_demux->p_sys, demux_sys_t ); \
-    memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) );
+    memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) ); } while(0)
 
-#define STANDARD_DEMUX_INIT_MSG( msg ) \
-    p_demux->pf_control = Control; \
-    p_demux->pf_demux = Demux; \
-    MALLOC_ERR( p_demux->p_sys, demux_sys_t ); \
-    memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) ); \
-    msg_Dbg( p_demux, msg ); \
+#define STANDARD_DEMUX_INIT_MSG( msg ) do { \
+    DEMUX_INIT_COMMON();                    \
+    msg_Dbg( p_demux, msg ); } while(0)
 
 #define DEMUX_BY_EXTENSION( ext ) \
     demux_t *p_demux = (demux_t *)p_this; \
     if( !demux2_IsPathExtension( p_demux, ext ) ) \
         return VLC_EGENERIC; \
-    STANDARD_DEMUX_INIT;
+    DEMUX_INIT_COMMON();
 
 #define DEMUX_BY_EXTENSION_MSG( ext, msg ) \
     demux_t *p_demux = (demux_t *)p_this; \
@@ -169,7 +166,7 @@ static inline vlc_bool_t demux2_IsForced( demux_t *p_demux, const char *psz_name
     demux_t *p_demux = (demux_t *)p_this; \
     if( !demux2_IsPathExtension( p_demux, ext ) && !demux2_IsForced( p_demux, module ) ) \
         return VLC_EGENERIC; \
-    STANDARD_DEMUX_INIT;
+    DEMUX_INIT_COMMON();
 
 #define DEMUX_BY_EXTENSION_OR_FORCED_MSG( ext, module, msg ) \
     demux_t *p_demux = (demux_t *)p_this; \
@@ -185,10 +182,7 @@ static inline vlc_bool_t demux2_IsForced( demux_t *p_demux, const char *psz_name
     if( stream_Peek( p_demux->s , &zepeek, size ) < size ) { \
         msg_Dbg( p_demux, "not enough data" ); goto error; }
 
-#define CHECK_DISCARD_PEEK( size ) { uint8_t *p_peek; \
-    if( stream_Peek( p_demux->s , &p_peek, size ) < size ) return VLC_EGENERIC;}
-
-#define POKE( peek, stuff, size ) (strncasecmp( (char *)peek, stuff, size )==0)
+#define POKE( peek, stuff, size ) (strncasecmp( (const char *)peek, stuff, size )==0)
 
 #define COMMON_INIT_PACKETIZER( location ) \
     location = vlc_object_create( p_demux, VLC_OBJECT_PACKETIZER ); \
index 6e47a99948d5b32e104b76c33c0bd58262b6caf5..03daa723ec592b4f9263cbc765db3df5d2194102 100644 (file)
@@ -209,7 +209,7 @@ static int Open( vlc_object_t *p_this )
     free( psz_name );
 
     /* Fill p_demux field */
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
     p_sys->dvdnav = p_dvdnav;
 
     ps_track_init( p_sys->tk );
index f34ad43e2b243ecdb40fe70515340d8d1a8eacc9..73072163883a5b989dc1476e15fafbee7fdf0fea 100644 (file)
@@ -247,7 +247,7 @@ static int Open( vlc_object_t *p_this )
     msg_Dbg( p_demux, "VMG opened" );
 
     /* Fill p_demux field */
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
 
     ps_track_init( p_sys->tk );
     p_sys->i_aspect = -1;
index 34532b31f4023388ee4720f2bc6d750170320a58..2e29b7d550bd9093b828281e6b94ca0703cb2ee9 100644 (file)
@@ -97,7 +97,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
 
     /* Set up p_demux */
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
     p_demux->info.i_update = 0;
     p_demux->info.i_title = 0;
     p_demux->info.i_seekpoint = 0;
index c19831d671daf8018df936a95ae8cc13cf358005..b05bd4f7f22a8e93c5b530e3a03b160a7dd37b09 100644 (file)
@@ -129,10 +129,8 @@ static int Open( vlc_object_t * p_this )
 
     if( CheckSync( p_peek + i_peek, &b_big_endian ) != VLC_SUCCESS )
     {
-        if( strncmp( p_demux->psz_demux, "a52", 3 ) )
-        {
+        if( !p_demux->b_force )
             return VLC_EGENERIC;
-        }
 
         /* User forced */
         msg_Err( p_demux, "this doesn't look like a A52 audio stream, "
@@ -140,7 +138,7 @@ static int Open( vlc_object_t * p_this )
     }
 
     /* Fill p_demux fields */
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
     p_sys->b_start = VLC_TRUE;
     p_sys->i_mux_rate = 0;
     p_sys->b_big_endian = b_big_endian;
index 3dfcb76ae3a3dbcb3532cec438e5bb03a402d7f8..d1871a08d21aa42d62dfcdb678b8c921e87880f9 100644 (file)
@@ -74,7 +74,7 @@ static int Demux  ( demux_t *p_demux );
 static int Control( demux_t *p_demux, int i_query, va_list args );
 
 /* GetF80BE: read a 80 bits float in big endian */
-static unsigned int GetF80BE( uint8_t p[10] )
+static unsigned int GetF80BE( const uint8_t p[10] )
 {
     unsigned int i_mantissa = GetDWBE( &p[2] );
     int          i_exp = 30 - p[1];
@@ -112,7 +112,7 @@ static int Open( vlc_object_t *p_this )
     stream_Read( p_demux->s, NULL, 12 );
 
     /* Fill p_demux field */
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
     es_format_Init( &p_sys->fmt, UNKNOWN_ES, 0 );
     p_sys->i_time = 1;
     p_sys->i_ssnd_pos = -1;
index 187825cd2afcc920ad2fe0ef70579b758bce79e3..36f38ef7b0eeb7600e90654509714316c3691b10 100644 (file)
@@ -127,7 +127,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
     p_sys->i_time = 1;
     p_sys->i_header_size = GetDWBE( &hdr[0] );
 
index 02c31f752757a7fabc3cfa549172abfb8bb890a5..ff4092bc8cb01ca36481d17016598d652dfbdf67 100644 (file)
@@ -225,7 +225,7 @@ static int Open( vlc_object_t * p_this )
     unsigned int i_track;
     unsigned int i, i_peeker;
 
-    uint8_t  *p_peek;
+    const uint8_t *p_peek;
 
     /* Is it an avi file ? */
     if( stream_Peek( p_demux->s, &p_peek, 200 ) < 200 ) return VLC_EGENERIC;
@@ -1898,7 +1898,7 @@ static void AVI_ParseStreamHeader( vlc_fourcc_t i_id,
  ****************************************************************************/
 static int AVI_PacketGetHeader( demux_t *p_demux, avi_packet_t *p_pk )
 {
-    uint8_t  *p_peek;
+    const uint8_t *p_peek;
 
     if( stream_Peek( p_demux->s, &p_peek, 16 ) < 16 )
     {
index 678e060277f6e734bbc49217cecdfa6d8579ce20..8ef41156383a6b7149d24f08d0f2a4776fe0cfa1 100644 (file)
@@ -31,7 +31,7 @@
 
 #define __EVEN( x ) ( (x)&0x01 ? (x)+1 : (x) )
 
-static vlc_fourcc_t GetFOURCC( byte_t *p_buff )
+static vlc_fourcc_t GetFOURCC( const byte_t *p_buff )
 {
     return VLC_FOURCC( p_buff[0], p_buff[1], p_buff[2], p_buff[3] );
 }
@@ -46,7 +46,7 @@ void    _AVI_ChunkFree( stream_t *, avi_chunk_t *p_chk );
  ****************************************************************************/
 static int AVI_ChunkReadCommon( stream_t *s, avi_chunk_t *p_chk )
 {
-    uint8_t  *p_peek;
+    const uint8_t *p_peek;
     int i_peek;
 
     memset( p_chk, 0, sizeof( avi_chunk_t ) );
@@ -111,7 +111,7 @@ static int AVI_NextChunk( stream_t *s, avi_chunk_t *p_chk )
 static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
 {
     avi_chunk_t *p_chk;
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     vlc_bool_t b_seekable;
 
     if( p_container->common.i_chunk_size > 0 && p_container->common.i_chunk_size < 8 )
@@ -471,7 +471,7 @@ static void AVI_ChunkFree_idx1( avi_chunk_t *p_chk )
 {
     p_chk->idx1.i_entry_count = 0;
     p_chk->idx1.i_entry_max   = 0;
-    FREENULL( p_chk->idx1.entry )
+    FREENULL( p_chk->idx1.entry );
 }
 
 
index f9e2e7776908752daea0a86379a59b97349cf4a7..de685a519231462312ad264381aa71163e67d7cf 100644 (file)
@@ -73,9 +73,7 @@ static int Open( vlc_object_t * p_this )
 
     /* Identify cdg file by extension, as there is no simple way to
      * detect it */
-    if( !demux2_IsPathExtension( p_demux, ".cdg" ) &&
-        !demux2_IsPathExtension( p_demux, ".CDG" ) &&
-        !demux2_IsForced( p_demux, "cdg" ) )
+    if( !demux2_IsPathExtension( p_demux, ".cdg" ) && !p_demux->b_force )
         return VLC_EGENERIC;
 
     /* CDG file size has to be multiple of CDG_FRAME_SIZE (it works even
index 80efc3a079dafbd8d596b22290734b043acc1d18..7023ffbd9acf00eb912b8ce444ad360a391f5504 100644 (file)
@@ -91,7 +91,7 @@ static int Open( vlc_object_t * p_this )
     vlc_bool_t  b_append;
 
     /* Accept only if forced */
-    if( strcasecmp( p_demux->psz_demux, "dump" ) )
+    if( !p_demux->b_force )
         return VLC_EGENERIC;
 
     var_Create( p_demux, "demuxdump-append", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
index c4ea299cdd0e75c2bb1863954fc0c6ebd90b6dbd..d448e07a1c176533e8723b34708488fc81955d88 100644 (file)
@@ -140,16 +140,15 @@ static int Open( vlc_object_t * p_this )
 
     if( CheckSync( p_peek + i_peek ) != VLC_SUCCESS )
     {
-        if( strncmp( p_demux->psz_demux, "dts", 3 ) )
-        {
+        if( !p_demux->b_force )
             return VLC_EGENERIC;
-        }
+
         /* User forced */
         msg_Err( p_demux, "this doesn't look like a DTS audio stream, "
                  "continuing anyway" );
     }
 
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
  
     INIT_APACKETIZER( p_sys->p_packetizer, 'd','t','s',' ' );
     LOAD_PACKETIZER_OR_FAIL( p_sys->p_packetizer, "DTS" );
index 173fb8103c10bea46b2db7f3632441edd32a9b8d..bb17b7ba677000e6874a4fe62637fc3d8731bd9e 100644 (file)
@@ -620,7 +620,7 @@ static void ParseComment( demux_t *p_demux, const uint8_t *p_data, int i_data )
 #define IF_EXTRACT(txt,var) \
     if( !strncasecmp(psz, txt, strlen(txt)) ) \
     { \
-        char * oldval = vlc_meta_Get( p_sys->p_meta, vlc_meta_ ## var ); \
+        const char *oldval = vlc_meta_Get( p_sys->p_meta, vlc_meta_ ## var ); \
         if( oldval ) \
         { \
             char * newval; \
@@ -630,7 +630,6 @@ static void ParseComment( demux_t *p_demux, const uint8_t *p_data, int i_data )
         } \
         else \
             vlc_meta_Set( p_sys->p_meta, vlc_meta_ ## var, &psz[strlen(txt)] ); \
-        free( oldval ); \
     }
         IF_EXTRACT("TITLE=", Title )
         else IF_EXTRACT("ALBUM=", Album )
index 15f33c1825d6ddb19baa61dc210e7b269426414f..ddd86b87248fcd1c937bebacece4d9b50131990e 100644 (file)
@@ -114,7 +114,7 @@ static int Open( vlc_object_t *p_this )
     vlc_value_t val;
  
     /* We accept file based on extention match */
-    if( strcasecmp( p_demux->psz_demux, "gme" ) )
+    if( !p_demux->b_force )
     {
         if( ( ext = strrchr( p_demux->psz_path, '.' ) ) == NULL ||
             stream_Size( p_demux->s ) == 0 ) return VLC_EGENERIC;
index ed3deba3c4ee35953709e3681afae3a5c889c05c..ec5e5c038e38cf3cd0f42a2e3369160b5979c9cc 100644 (file)
@@ -74,7 +74,7 @@ struct demux_sys_t
     mtime_t         i_frame_length;
     char            *psz_separator;
     int             i_frame_size_estimate;
-    uint8_t         *p_peek;
+    const uint8_t   *p_peek;
     int             i_data_peeked;
 };
 
@@ -117,7 +117,7 @@ static vlc_bool_t Peek( demux_t *p_demux, vlc_bool_t b_first )
 static char* GetLine( demux_t *p_demux, int *p_pos )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    uint8_t     *p_buf;
+    const uint8_t *p_buf;
     int         i_size;
     int         i;
     char        *p_line;
@@ -300,7 +300,6 @@ static int Open( vlc_object_t * p_this )
     int         i_size;
     int         b_matched = VLC_FALSE;
     vlc_value_t val;
-    char *psz_ext;
 
     p_demux->pf_control = Control;
     p_demux->p_sys      = p_sys = malloc( sizeof( demux_sys_t ) );
@@ -342,9 +341,8 @@ static int Open( vlc_object_t * p_this )
     /* Check for jpeg file extension */
     p_sys->b_still = VLC_FALSE;
     p_sys->i_still_end = 0;
-    psz_ext = strrchr( p_demux->psz_path, '.' );
-    if( psz_ext && ( !strcasecmp( psz_ext, ".jpeg" ) ||
-                     !strcasecmp( psz_ext, ".jpg" ) ) )
+    if( demux2_IsPathExtension( p_demux, ".jpeg" ) ||
+        demux2_IsPathExtension( p_demux, ".jpg" ) )
     {
         p_sys->b_still = VLC_TRUE;
         if( val.f_float)
index be77604b24a28c6abec8df76e3812c2a6c9874c3..813294d01e118a672ed1d262e18c54f868f6d33f 100644 (file)
@@ -129,14 +129,14 @@ static int Open( vlc_object_t *p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    char        *ext;
-    int         i;
     ModPlug_Settings settings;
     vlc_value_t val;
 
     /* We accept file based on extension match */
-    if( strcasecmp( p_demux->psz_demux, "mod" ) )
+    if( !p_demux->b_force )
     {
+        char *ext;
+        int i;
         if( ( ext = strrchr( p_demux->psz_path, '.' ) ) == NULL ||
             stream_Size( p_demux->s ) == 0 ) return VLC_EGENERIC;
 
index d1a35bd88b64610ae9ccd6e567d9d1f328918145..68b33247f20014d8dd42019dd0f3dbef82ef91e2 100644 (file)
@@ -703,7 +703,7 @@ static int MP4_ReadBox_url( stream_t *p_stream, MP4_Box_t *p_box )
 
 static void MP4_FreeBox_url( MP4_Box_t *p_box )
 {
-    FREENULL( p_box->data.p_url->psz_location )
+    FREENULL( p_box->data.p_url->psz_location );
 }
 
 static int MP4_ReadBox_urn( stream_t *p_stream, MP4_Box_t *p_box )
@@ -1552,7 +1552,7 @@ static int MP4_ReadBox_stss( stream_t *p_stream, MP4_Box_t *p_box )
 
 static void MP4_FreeBox_stss( MP4_Box_t *p_box )
 {
-    FREENULL( p_box->data.p_stss->i_sample_number )
+    FREENULL( p_box->data.p_stss->i_sample_number );
 }
 
 static int MP4_ReadBox_stsh( stream_t *p_stream, MP4_Box_t *p_box )
@@ -1589,8 +1589,8 @@ static int MP4_ReadBox_stsh( stream_t *p_stream, MP4_Box_t *p_box )
 
 static void MP4_FreeBox_stsh( MP4_Box_t *p_box )
 {
-    FREENULL( p_box->data.p_stsh->i_shadowed_sample_number )
-    FREENULL( p_box->data.p_stsh->i_sync_sample_number )
+    FREENULL( p_box->data.p_stsh->i_shadowed_sample_number );
+    FREENULL( p_box->data.p_stsh->i_sync_sample_number );
 }
 
 
@@ -1621,7 +1621,7 @@ static int MP4_ReadBox_stdp( stream_t *p_stream, MP4_Box_t *p_box )
 
 static void MP4_FreeBox_stdp( MP4_Box_t *p_box )
 {
-    FREENULL( p_box->data.p_stdp->i_priority )
+    FREENULL( p_box->data.p_stdp->i_priority );
 }
 
 static int MP4_ReadBox_padb( stream_t *p_stream, MP4_Box_t *p_box )
@@ -1970,7 +1970,7 @@ static int MP4_ReadBox_rdrf( stream_t *p_stream, MP4_Box_t *p_box )
 
 static void MP4_FreeBox_rdrf( MP4_Box_t *p_box )
 {
-    FREENULL( p_box->data.p_rdrf->psz_ref )
+    FREENULL( p_box->data.p_rdrf->psz_ref );
 }
 
 
index d359cb74a13af0ac5ce803a81c2df550afbc8b38..d34ddba908f30aff892aacf725b6efbcd54cbc3f 100644 (file)
@@ -97,7 +97,7 @@ static int Open( vlc_object_t * p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
     es_format_t fmt;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     module_t    *p_id3;
 
     if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 )
@@ -111,18 +111,12 @@ static int Open( vlc_object_t * p_this )
         if( i_version  < 4 || i_version > 6 )
             return VLC_EGENERIC;
 
-        if( !p_demux->psz_demux || strcmp( p_demux->psz_demux, "mpc" ) )
+        if( !p_demux->b_force )
         {
             /* Check file name extension */
-            int i_len;
-            if( !p_demux->psz_path )
-                return VLC_EGENERIC;
-
-            i_len = strlen( p_demux->psz_path );
-            if( i_len < 4 ||
-                ( strcasecmp( &p_demux->psz_path[i_len-4], ".mpc" ) &&
-                  strcasecmp( &p_demux->psz_path[i_len-4], ".mp+" ) &&
-                  strcasecmp( &p_demux->psz_path[i_len-4], ".mpp" ) ) )
+            if( !demux2_IsPathExtension( p_demux, ".mpc" ) &&
+                !demux2_IsPathExtension( p_demux, ".mp+" ) &&
+                !demux2_IsPathExtension( p_demux, ".mpp" ) )
                 return VLC_EGENERIC;
         }
     }
index 788156f085920202fc620a0d7d97389e2d0f815e..414addfa9e5a62b5ba75c312d451b69032981a79 100644 (file)
@@ -74,7 +74,7 @@ static int Open( vlc_object_t * p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     vlc_value_t val;
 
     if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC;
index f7c7d09cd4b37fc948da5d3e5e1ab75f39f39b2b..049e9a878225dc86cf70a74b379e1857d9063c79 100644 (file)
@@ -78,23 +78,14 @@ static int Open( vlc_object_t * p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
     module_t    *p_id3;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     int         b_forced = VLC_FALSE;
 
-    if( p_demux->psz_path )
-    {
-        int i_len = strlen( p_demux->psz_path );
-
-        if( i_len > 4 && !strcasecmp( &p_demux->psz_path[i_len - 4], ".aac" ) )
-        {
-            b_forced = VLC_TRUE;
-        }
-    }
+    if( demux2_IsPathExtension( p_demux, ".aac" ) )
+        b_forced = VLC_TRUE;
 
     if( !p_demux->b_force && !b_forced )
-    {
         return VLC_EGENERIC;
-    }
 
     /* peek the begining (10 is for adts header) */
     if( stream_Peek( p_demux->s, &p_peek, 10 ) < 10 )
index 12e12bb5f50aa5a6552f6e73cac718d715522a1e..b86a5f7175e3b6773be490ccfc5ff13b91359809 100644 (file)
@@ -74,7 +74,7 @@ static int Open( vlc_object_t * p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     vlc_value_t val;
 
     if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
index bbe5d44353c4daa8514a0bea0067c41773c50f55..a7c9f5753627dad19aa9e8094b7c4442e7030892 100644 (file)
@@ -120,18 +120,12 @@ static int Open( vlc_object_t * p_this )
     vlc_bool_t   b_forced = VLC_FALSE;
 
     uint32_t     header;
-    uint8_t     *p_peek;
+    const uint8_t     *p_peek;
     module_t    *p_id3;
     block_t     *p_block_in, *p_block_out;
 
-    if( p_demux->psz_path )
-    {
-        int  i_len = strlen( p_demux->psz_path );
-        if( i_len > 4 && !strcasecmp( &p_demux->psz_path[i_len - 4], ".mp3" ) )
-        {
-            b_forced = VLC_TRUE;
-        }
-    }
+    if( demux2_IsPathExtension( p_demux, ".mp3" ) )
+        b_forced = VLC_TRUE;
 
     if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
 
@@ -156,7 +150,7 @@ static int Open( vlc_object_t * p_this )
         if( !b_ok && !p_demux->b_force ) return VLC_EGENERIC;
     }
 
-    STANDARD_DEMUX_INIT; p_sys = p_demux->p_sys;
+    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
     memset( p_sys, 0, sizeof( demux_sys_t ) );
     p_sys->p_es = 0;
     p_sys->b_start = VLC_TRUE;
@@ -171,7 +165,7 @@ static int Open( vlc_object_t * p_this )
     if( HeaderCheck( header ) )
     {
         int i_xing, i_skip;
-        uint8_t *p_xing;
+        const uint8_t *p_xing;
 
         if( ( i_xing = stream_Peek( p_demux->s, &p_xing, 1024 ) ) < 21 )
             return VLC_SUCCESS; /* No header */
index 0757bf0b50a411b1c154d996599f9af5d68ff950..204307fe5fe3a47f0de223a3c1079aa98b76e89f 100644 (file)
@@ -70,7 +70,7 @@ static int Open( vlc_object_t * p_this )
     demux_sys_t *p_sys;
     vlc_bool_t   b_forced = VLC_FALSE;
 
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
 
     es_format_t  fmt;
 
@@ -80,10 +80,8 @@ static int Open( vlc_object_t * p_this )
         return VLC_EGENERIC;
     }
 
-    if( !strncmp( p_demux->psz_demux, "mpgv", 4 ) )
-    {
+    if( p_demux->b_force )
         b_forced = VLC_TRUE;
-    }
 
     if( p_peek[0] != 0x00 || p_peek[1] != 0x00 || p_peek[2] != 0x01 )
     {
index 9a78cd3ed0a71aeded34b9d63b977cfa39ade080..509728c4e1e7f6efde79689efca00595d21638b7 100644 (file)
@@ -264,7 +264,7 @@ static char *nscdec( vlc_object_t *p_demux, char* p_encoded )
 static int DemuxOpen( vlc_object_t * p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    byte_t *p_peek;
+    const byte_t *p_peek;
     int i_size;
 
     /* Lets check the content to see if this is a NSC file */
index d864b8306207f13a3ae2da6848308e62e39bda88..236332ac93a59a4d6158520b1b696f50957c2e0d 100644 (file)
@@ -93,10 +93,8 @@ static int Open( vlc_object_t *p_this )
     if( memcmp( p_peek, "NSVf", 4 ) && memcmp( p_peek, "NSVs", 4 ) )
     {
        /* In case we had force this demuxer we try to resynch */
-        if( strcmp( p_demux->psz_demux, "nsv" ) || ReSynch( p_demux ) )
-        {
+        if( !p_demux->b_force || ReSynch( p_demux ) )
             return VLC_EGENERIC;
-        }
     }
 
     /* Fill p_demux field */
index cfadb583b76b491065de89c322b9b403b9139520..bdc02a34010cf27b522686fcdc49f3a2ded7cba9 100644 (file)
@@ -192,7 +192,7 @@ static int Open( vlc_object_t * p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     frame_header_t fh;
     vlc_bool_t  b_extended;
 
index fb82d01fe39a4449ccbb258e28ba8adb5324325a..83271d051746d32415bce8ae030351982e4630ff 100644 (file)
@@ -186,7 +186,7 @@ static int Open( vlc_object_t * p_this )
 
     /* Check if we are dealing with an ogg stream */
     if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
-    if( strcmp( p_demux->psz_demux, "ogg" ) && memcmp( p_peek, "OggS", 4 ) )
+    if( !p_demux->b_force && memcmp( p_peek, "OggS", 4 ) )
     {
         return VLC_EGENERIC;
     }
index 40ddbfbe4b0b46b887d3f958472a897a399712d8..4e76dba18abc34a931bec7518322d3785cb13e2b 100644 (file)
@@ -184,7 +184,7 @@ static int ParseTime(char *s, size_t i_strlen)
 int E_(Import_ASX)( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     CHECK_PEEK( p_peek, 10 );
 
     // skip over possible leading empty lines and empty spaces
@@ -529,14 +529,14 @@ static int Demux( demux_t *p_demux )
                     input_ItemAddSubItem( p_current_input, p_entry );
                 }
 
-                /* cleanup entry */
-                FREENULL( psz_href )
-                FREENULL( psz_title_entry )
-                FREENULL( psz_base_entry )
-                FREENULL( psz_artist_entry )
-                FREENULL( psz_copyright_entry )
-                FREENULL( psz_moreinfo_entry )
-                FREENULL( psz_abstract_entry )
+                /* cleanup entry */;
+                FREENULL( psz_href );
+                FREENULL( psz_title_entry );
+                FREENULL( psz_base_entry );
+                FREENULL( psz_artist_entry );
+                FREENULL( psz_copyright_entry );
+                FREENULL( psz_moreinfo_entry );
+                FREENULL( psz_abstract_entry );
                 b_entry = VLC_FALSE;
             }
             else if( !strncasecmp( psz_parse, "<Entry", 6 ) )
index 7f6d4e7de1dc457a3345935c7b2eda6233fb14ea..6795b37c2ccea033e0a2b8830d38a0ee5415f206 100644 (file)
@@ -50,7 +50,7 @@ static int ParseLine( char *, char **, char ***, int *);
 int E_(Import_DVB)( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     int     i_peek;
     vlc_bool_t b_valid = VLC_FALSE;
 
index 988c8c42f05a274b0c7a0f5b19fb1150ab86a215..ed3aef58c90f4d880a2a873ac6e02bc7ee9d6be0 100644 (file)
@@ -74,7 +74,7 @@ int E_(Import_GVP)( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
     int i_peek, i, b_found = VLC_FALSE;
-    byte_t *p_peek;
+    const byte_t *p_peek;
 
     i_peek = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
 
@@ -90,7 +90,7 @@ int E_(Import_GVP)( vlc_object_t *p_this )
 
     if( !b_found ) return VLC_EGENERIC;
 
-    STANDARD_DEMUX_INIT_MSG(  "using Google Video Playlist (gvp) import" )
+    STANDARD_DEMUX_INIT_MSG(  "using Google Video Playlist (gvp) import" );
     p_demux->pf_control = Control;
     p_demux->pf_demux = Demux;
     MALLOC_ERR( p_demux->p_sys, demux_sys_t );
index 88be49c38ff325bb9d4d70513649be327fc6ba44..9c8ab79bb919056d6dae4ee38903d7c0411ce284 100644 (file)
@@ -54,7 +54,7 @@ int E_(Import_IFO)( vlc_object_t *p_this )
         && !strcasecmp( psz_file + strlen( "VTS_00_0" ) , ".IFO" ) ) ) )
     {
         int i_peek;
-        byte_t *p_peek;
+        const byte_t *p_peek;
         i_peek = stream_Peek( p_demux->s, &p_peek, 8 );
 
         if( strncmp( p_peek, "DVDVIDEO", 8 ) )
index 93230183cb2547cc79040dbf90a6e20448dbeaae..7d2a436b9feb15d41c9d8222213ae3ffff519b9f 100644 (file)
@@ -50,7 +50,7 @@ static void parseEXTINF( char *psz_string, char **ppsz_artist, char **ppsz_name,
 int E_(Import_M3U)( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     CHECK_PEEK( p_peek, 8 );
 
     if(! ( POKE( p_peek, "#EXTM3U", 7 ) || POKE( p_peek, "RTSPtext", 8 ) ||
index d499db0badab8b366cc4716b1fbbc81635e2e952..caf5c36655b98e560e22099ee8cb381c10cf831d 100644 (file)
@@ -47,7 +47,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
 int E_(Import_PLS)( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     CHECK_PEEK( p_peek, 10 );
 
     if( POKE( p_peek, "[playlist]", 10 ) || POKE( p_peek, "[Reference]", 10 ) ||
index 50f654062e13c671101199a419c29219021a1567..4e284e2edb68b49a0ca2178007e3f44c3c254c4c 100644 (file)
@@ -134,7 +134,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
 int E_(Import_SGIMB)( vlc_object_t * p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    byte_t *p_peek;
+    const byte_t *p_peek;
     int i_size;
 
     /* Lets check the content to see if this is a sgi mediabase file */
index 616fc33e2bb065832ade687303fd6feb2870e561..e54202ce416397acc0406df28a3d46d4100cdb0f 100644 (file)
@@ -425,13 +425,13 @@ static int DemuxStation( demux_t *p_demux )
                     input_ItemAddSubItem( p_sys->p_current_input, p_input );
 
                     FREENULL( psz_name );
-                    FREENULL( psz_mt )
-                    FREENULL( psz_id )
-                    FREENULL( psz_br )
-                    FREENULL( psz_genre )
-                    FREENULL( psz_ct )
-                    FREENULL( psz_lc )
-                    FREENULL( psz_rt )
+                    FREENULL( psz_mt );
+                    FREENULL( psz_id );
+                    FREENULL( psz_br );
+                    FREENULL( psz_genre );
+                    FREENULL( psz_ct );
+                    FREENULL( psz_lc );
+                    FREENULL( psz_rt );
                 }
                 free( psz_eltname );
                 break;
index 94e78256fff59e028e7308073600365fb535fb58..7e50a49e70de1a51aab7ef8f36091d689b4116b4 100644 (file)
@@ -98,7 +98,7 @@ static int OpenCommon( vlc_object_t *p_this, vlc_bool_t b_force )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
 
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
 
     if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 )
     {
@@ -502,7 +502,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
  */
 static int ps_pkt_resynch( stream_t *s, uint32_t *pi_code )
 {
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     int     i_peek;
     int     i_skip;
 
@@ -545,7 +545,7 @@ static int ps_pkt_resynch( stream_t *s, uint32_t *pi_code )
 
 static block_t *ps_pkt_read( stream_t *s, uint32_t i_code )
 {
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     int      i_peek = stream_Peek( s, &p_peek, 14 );
     int      i_size = ps_pkt_size( p_peek, i_peek );
 
index 6dfd96b1af289782062688638ff6542242596f42..b997f7acf8717e83799d7c0ba81eec80d0d7f2bb 100644 (file)
@@ -246,7 +246,7 @@ static inline int ps_pkt_id( block_t *p_pkt )
 /* return the size of the next packet
  * XXX you need to give him at least 14 bytes (and it need to start as a
  * valid packet) */
-static inline int ps_pkt_size( uint8_t *p, int i_peek )
+static inline int ps_pkt_size( const uint8_t *p, int i_peek )
 {
     if( p[3] == 0xb9 && i_peek >= 4 )
     {
index bc255fef9a7a2297c480b423b7b1664be04819ac..c09ecdadc75a23e915cacff53da67e605e3ecdbf 100644 (file)
@@ -77,16 +77,14 @@ static int Open( vlc_object_t *p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
     es_format_t  fmt;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
 
     if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC;
     if( p_peek[0] != 'A' || p_peek[1] != 'V' || p_peek[4] != 0x55 )
     {
         /* In case we had forced this demuxer we try to resynch */
-        if( strcasecmp( p_demux->psz_demux, "pva" ) || ReSynch( p_demux ) )
-        {
+        if( !p_demux->b_force || ReSynch( p_demux ) )
             return VLC_EGENERIC;
-        }
     }
 
     /* Fill p_demux field */
@@ -133,7 +131,7 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     int         i_size;
     block_t     *p_frame;
     int64_t     i_pts;
@@ -337,7 +335,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
  *****************************************************************************/
 static int ReSynch( demux_t *p_demux )
 {
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
     int      i_skip;
     int      i_peek;
 
index 648772c8863c6090f048fc3493f1cbdc265591dc..f08ea420d48a04900927009132e68d7d9d511f55 100644 (file)
@@ -134,7 +134,6 @@ static int Open( vlc_object_t * p_this )
     uint32_t    i_dword;
     dv_header_t dv_header;
     dv_id_t     dv_id;
-    char        *psz_ext;
 
     /* It isn't easy to recognize a raw DV stream. The chances that we'll
      * mistake a stream from another type for a raw DV stream are too high, so
@@ -142,12 +141,8 @@ static int Open( vlc_object_t * p_this )
      * it is possible to force this demux. */
 
     /* Check for DV file extension */
-    psz_ext = strrchr( p_demux->psz_path, '.' );
-    if( ( !psz_ext || strcasecmp( psz_ext, ".dv") ) &&
-        strcmp(p_demux->psz_demux, "rawdv") )
-    {
+    if( !demux2_IsPathExtension( p_demux, ".dv" ) && !p_demux->b_force )
         return VLC_EGENERIC;
-    }
 
     if( stream_Peek( p_demux->s, &p_peek, DV_PAL_FRAME_SIZE ) <
         DV_NTSC_FRAME_SIZE )
index 7186b984d6e9bacc0af74e4f4f612836e5dc842b..fcd8c6d8d07c80477054c915c04e268990663d57 100644 (file)
@@ -154,10 +154,8 @@ static int Open( vlc_object_t * p_this )
                 break;
             }
     }
-    if( ( !b_valid ) && strcmp(p_demux->psz_demux, "rawvid") )
-    {
+    if( !b_valid && !p_demux->b_force )
         return VLC_EGENERIC;
-    }
 
     /* Set p_input field */
     p_demux->pf_demux   = Demux;
index 4dc0b299c6b40d0fc0be20deb5e73d387dc303b1..31fed302ca1a002fae120657cd2dad456348a83d 100644 (file)
@@ -182,7 +182,7 @@ static int Open ( vlc_object_t *p_this )
     int  (*pf_read)( demux_t *, subtitle_t* );
     int            i, i_max;
 
-    if( strcmp( p_demux->psz_demux, "subtitle" ) )
+    if( !p_demux->b_force )
     {
         msg_Dbg( p_demux, "subtitle demux discarded" );
         return VLC_EGENERIC;
index 9653b57a6d3d3e94e37aa80622e41b0412c1cbb6..3c372887578b455c1a9e35f7cc63a468a1a7c987 100644 (file)
@@ -412,7 +412,8 @@ static int Open( vlc_object_t *p_this )
     }
     if( i_sync >= TS_PACKET_SIZE_MAX && !b_topfield )
     {
-        if( strcmp( p_demux->psz_demux, "ts" ) ) return VLC_EGENERIC;
+        if( !p_demux->b_force )
+            return VLC_EGENERIC;
         msg_Warn( p_demux, "this does not look like a TS stream, continuing" );
     }
 
@@ -450,7 +451,7 @@ static int Open( vlc_object_t *p_this )
     {
         i_packet_size = TS_PACKET_SIZE_204;
     }
-    else if( !strcmp( p_demux->psz_demux, "ts" ) )
+    else if( p_demux->b_force )
     {
         i_packet_size = TS_PACKET_SIZE_188;
     }
index bbf08985371dce24226a44ee9c834707b9b7e1df..20d7d7e8298d5c72f00b835246c334bdc48ec588 100644 (file)
@@ -79,7 +79,7 @@ static int Open( vlc_object_t * p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
     es_format_t fmt;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     uint8_t     p_header[22];
     uint8_t     *p_seektable;
     int         i_seektable_size = 0, i;
index f1fa72bb4b019c2ed53ccc7bb17a0ea9d7bc739f..77d90b429ce5d066e4083b2739a3bd9ddd001e2a 100644 (file)
@@ -151,7 +151,7 @@ static int TyOpen(vlc_object_t *p_this)
     demux_t *p_demux = (demux_t *)p_this;
     demux_sys_t *p_sys;
     es_format_t fmt;
-    uint8_t *p_peek;
+    const uint8_t *p_peek;
 
     /* peek at the first 12 bytes. */
     /* for TY streams, they're always the same */
@@ -165,8 +165,8 @@ static int TyOpen(vlc_object_t *p_this)
         /* doesn't look like a TY file... */
         char *psz_ext = strrchr(p_demux->psz_path, '.');
 
-        if( !p_demux->b_force &&
-            (!psz_ext || strcasecmp(psz_ext, ".ty")) ) return VLC_EGENERIC;
+        if( !p_demux->b_force && !demux2_IsPathExtension( p_demux, ".ty" ) )
+            return VLC_EGENERIC;
         msg_Warn( p_demux, "this does not look like a TY file, "
                   "continuing anyway..." );
     }
index d5e1a3d2ed6b1984e2e4741d244d416dd563c07c..b96b58e1aa52394bafb67cf9d097c63408acfe47 100644 (file)
@@ -73,7 +73,7 @@ static int Open( vlc_object_t * p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    uint8_t     *p_peek;
+    const uint8_t *p_peek;
     vlc_value_t val;
 
     if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC;
index 107b0abb29aaf18f0645a8832865fb5770f5965e..f41eef0fc11193d6cbac408f73d4d991ec12af97 100644 (file)
@@ -83,7 +83,7 @@ static int Open( vlc_object_t * p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
     xa_header_t p_xa;
-    uint8_t     *p_buf;
+    const uint8_t *p_buf;
 
     /* XA file heuristic */
     if( stream_Peek( p_demux->s, &p_buf, sizeof( p_xa ) )
index 6b2de374cadbb87591fabd9fa302c1ec42f86a12..cfe0125ce3bf5992372f3aebafc24e6aa6c93f1d 100644 (file)
@@ -70,7 +70,7 @@ static int __input_FindArtInCache( vlc_object_t *, input_item_t *p_item );
 vlc_bool_t input_MetaSatisfied( playlist_t *p_playlist, input_item_t *p_item,
                                 uint32_t *pi_mandatory, uint32_t *pi_optional )
 {
-    (void)p_playlist;
+    VLC_UNUSED(p_playlist);
     *pi_mandatory = VLC_META_ENGINE_TITLE | VLC_META_ENGINE_ARTIST;
 
     uint32_t i_meta = input_CurrentMetaFlags( p_item->p_meta );
index 2cff5be1386c27ec97f1c45c8ea6fe8a55eea4c7..e03e60047c915681116b4e0b2b763475ef6ddc8b 100644 (file)
@@ -476,7 +476,7 @@ static int StateCallback( vlc_object_t *p_this, char const *psz_cmd,
                           void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)psz_cmd; (void)oldval; (void)p_data;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( newval.i_int == PLAYING_S || newval.i_int == PAUSE_S )
     {
@@ -491,7 +491,7 @@ static int RateCallback( vlc_object_t *p_this, char const *psz_cmd,
                          vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     /* Problem with this way: the "rate" variable is update after the input thread do the change */
     if( !strcmp( psz_cmd, "rate-slower" ) )
@@ -516,7 +516,7 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, length;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "position-offset" ) )
     {
@@ -549,7 +549,7 @@ static int TimeCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, length;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "time-offset" ) )
     {
@@ -581,7 +581,7 @@ static int ProgramCallback( vlc_object_t *p_this, char const *psz_cmd,
                             void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)psz_cmd; (void)oldval; (void)p_data;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     input_ControlPush( p_input, INPUT_CONTROL_SET_PROGRAM, &newval );
 
@@ -594,7 +594,7 @@ static int TitleCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, count;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "next-title" ) )
     {
@@ -627,7 +627,7 @@ static int SeekpointCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t val, count;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "next-chapter" ) )
     {
@@ -660,7 +660,7 @@ static int NavigationCallback( vlc_object_t *p_this, char const *psz_cmd,
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
     vlc_value_t     val;
-    (void)psz_cmd; (void)oldval;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
 
     /* Issue a title change */
     val.i_int = (intptr_t)p_data;
@@ -680,7 +680,7 @@ static int ESCallback( vlc_object_t *p_this, char const *psz_cmd,
                        vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( newval.i_int < 0 )
     {
@@ -709,7 +709,7 @@ static int EsDelayCallback ( vlc_object_t *p_this, char const *psz_cmd,
                              vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)oldval; (void)p_data;
+    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     if( !strcmp( psz_cmd, "audio-delay" ) )
     {
@@ -730,7 +730,7 @@ static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd,
                              void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    (void)psz_cmd; (void)oldval; (void)p_data;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
     input_ControlPush( p_input, INPUT_CONTROL_SET_BOOKMARK, &newval );