]> git.sesse.net Git - vlc/blobdiff - modules/demux/au.c
Merge branch 1.0-bugfix
[vlc] / modules / demux / au.c
index 36f38ef7b0eeb7600e90654509714316c3691b10..bccf2ea6cf3ec532df464bef1121d7a835513eb3 100644 (file)
  * Preamble
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_demux.h>
 
 /* TODO:
 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( _("AU demuxer") );
-    set_capability( "demux2", 10 );
-    set_callbacks( Open, Close );
-    add_shortcut( "au" );
-vlc_module_end();
+vlc_module_begin ()
+    set_category( CAT_INPUT )
+    set_subcategory( SUBCAT_INPUT_DEMUX )
+    set_description( N_("AU demuxer") )
+    set_capability( "demux", 10 )
+    set_callbacks( Open, Close )
+    add_shortcut( "au" )
+vlc_module_end ()
 
 /*****************************************************************************
  * Local prototypes
@@ -104,12 +109,11 @@ static int Open( vlc_object_t *p_this )
     int          i_cat;
     int          i_samples, i_modulo;
 
-    CHECK_PEEK( p_peek, 4 );
+    if( stream_Peek( p_demux->s , &p_peek, 4 ) < 4 )
+        return VLC_EGENERIC;
 
     if( memcmp( p_peek, ".snd", 4 ) )
-    {
         return VLC_EGENERIC;
-    }
 
     /* skip signature */
     stream_Read( p_demux->s, NULL, 4 );   /* cannot fail */
@@ -152,14 +156,14 @@ static int Open( vlc_object_t *p_this )
     switch( GetDWBE( &hdr[8] ) )
     {
         case AU_ALAW_8:        /* 8-bit ISDN A-law */
-            p_sys->fmt.i_codec               = VLC_FOURCC( 'a','l','a','w' );
+            p_sys->fmt.i_codec               = VLC_CODEC_ALAW;
             p_sys->fmt.audio.i_bitspersample = 8;
             p_sys->fmt.audio.i_blockalign    = 1 * p_sys->fmt.audio.i_channels;
             i_cat                    = AU_CAT_PCM;
             break;
 
         case AU_MULAW_8:       /* 8-bit ISDN u-law */
-            p_sys->fmt.i_codec               = VLC_FOURCC( 'u','l','a','w' );
+            p_sys->fmt.i_codec               = VLC_CODEC_MULAW;
             p_sys->fmt.audio.i_bitspersample = 8;
             p_sys->fmt.audio.i_blockalign    = 1 * p_sys->fmt.audio.i_channels;
             i_cat                    = AU_CAT_PCM;
@@ -325,7 +329,7 @@ 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, p_sys->i_header_size, -1,
+    return demux_vaControlHelper( p_demux->s, p_sys->i_header_size, -1,
                                    p_sys->fmt.i_bitrate, p_sys->fmt.audio.i_blockalign,
                                    i_query, args );
 }