]> git.sesse.net Git - vlc/blobdiff - modules/demux/aiff.c
- Fix a bunch of warnings
[vlc] / modules / demux / aiff.c
index 8a5e80ebaeab51c26173d3c14321ed121d2e522e..51ed29b2c3f7b3a591717dd5bd4875056ee8fa69 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * aiff.c: Audio Interchange File Format demuxer
  *****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004-2007 the VideoLAN team
  * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
@@ -101,11 +101,12 @@ 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;
 
     if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 )
         return VLC_EGENERIC;
-    if( strncmp( (char *)&p_peek[0], "FORM", 4 ) || strncmp( (char *)&p_peek[8], "AIFF", 4 ) )
+    if( memcmp( p_peek, "FORM", 4 )
+     || memcmp( &p_peek[8], "AIFF", 4 ) )
         return VLC_EGENERIC;
 
     /* skip aiff header */
@@ -126,7 +127,7 @@ static int Open( vlc_object_t *p_this )
 
         msg_Dbg( p_demux, "chunk fcc=%4.4s size=%d", p_peek, i_size );
 
-        if( !strncmp( (char *)&p_peek[0], "COMM", 4 ) )
+        if( !memcmp( p_peek, "COMM", 4 ) )
         {
             CHECK_PEEK_GOTO( p_peek, 18+8 );
             es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 't', 'w', 'o', 's' ) );
@@ -137,7 +138,7 @@ static int Open( vlc_object_t *p_this )
             msg_Dbg( p_demux, "COMM: channels=%d samples_frames=%d bits=%d rate=%d",
                      GetWBE( &p_peek[8] ), GetDWBE( &p_peek[10] ), GetWBE( &p_peek[14] ), GetF80BE( &p_peek[16] ) );
         }
-        else if( !strncmp( (char *)&p_peek[0], "SSND", 4 ) )
+        else if( !memcmp( p_peek, "SSND", 4 ) )
         {
             CHECK_PEEK_GOTO( p_peek, 8+8 );
             p_sys->i_ssnd_pos = stream_Tell( p_demux->s );