]> git.sesse.net Git - vlc/blobdiff - modules/demux/a52.c
All: string review (refs: #438)
[vlc] / modules / demux / a52.c
index 7a257f772f86ed28c644b6e08af36a5960e39c37..710d74216198c0945a45497f12ab6e34fa1e95b5 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * a52.c : raw A/52 stream input module for vlc
  *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: a52.c,v 1.7 2004/03/03 11:40:19 fenrir Exp $
+ * Copyright (C) 2001 the VideoLAN team
+ * $Id$
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -39,6 +39,8 @@ static int  Open  ( vlc_object_t * );
 static void Close ( vlc_object_t * );
 
 vlc_module_begin();
+    set_category( CAT_INPUT );
+    set_subcategory( SUBCAT_INPUT_DEMUX );
     set_description( _("Raw A/52 demuxer") );
     set_capability( "demux2", 145 );
     set_callbacks( Open, Close );
@@ -79,18 +81,18 @@ static int Open( vlc_object_t * p_this )
     demux_sys_t *p_sys;
     byte_t      *p_peek;
     int         i_peek = 0;
-    vlc_bool_t  b_big_endian;
+    vlc_bool_t  b_big_endian = 0; /* Arbitrary initialisation */
 
     /* Check if we are dealing with a WAV file */
     if( stream_Peek( p_demux->s, &p_peek, 12 ) == 12 &&
-        !strncmp( p_peek, "RIFF", 4 ) && !strncmp( &p_peek[8], "WAVE", 4 ) )
+        !memcmp( p_peek, "RIFF", 4 ) && !memcmp( p_peek + 8, "WAVE", 4 ) )
     {
         int i_size;
 
         /* Skip the wave header */
         i_peek = 12 + 8;
         while( stream_Peek( p_demux->s, &p_peek, i_peek ) == i_peek &&
-               strncmp( p_peek + i_peek - 8, "data", 4 ) )
+               memcmp( p_peek + i_peek - 8, "data", 4 ) )
         {
             i_peek += GetDWLE( p_peek + i_peek - 4 ) + 8;
         }
@@ -165,7 +167,7 @@ static int Open( vlc_object_t * p_this )
                     VLC_FOURCC( 'a', '5', '2', ' ' ) );
 
     p_sys->p_packetizer->p_module =
-        module_Need( p_sys->p_packetizer, "packetizer", NULL );
+        module_Need( p_sys->p_packetizer, "packetizer", NULL, 0 );
     if( !p_sys->p_packetizer->p_module )
     {
         msg_Err( p_demux, "cannot find A52 packetizer" );
@@ -274,9 +276,12 @@ static int Demux( demux_t *p_demux )
 static int Control( demux_t *p_demux, int i_query, va_list args )
 {
     demux_sys_t *p_sys  = p_demux->p_sys;
-    return demux2_vaControlHelper( p_demux->s,
-                                   0, -1,
-                                   8*p_sys->i_mux_rate, 1, i_query, args );
+    if( i_query == DEMUX_SET_TIME )
+        return VLC_EGENERIC;
+    else
+        return demux2_vaControlHelper( p_demux->s,
+                                       0, -1,
+                                       8*p_sys->i_mux_rate, 1, i_query, args );
 }
 
 /*****************************************************************************