]> git.sesse.net Git - vlc/blobdiff - modules/codec/mpeg_audio.c
A bit of headers cleanup
[vlc] / modules / codec / mpeg_audio.c
index 9f633bd838b6268a4a19fae36c9f909aa31ca5ad..7edd2ead12b2d52c2b7b0f65ae35c243ea2453b2 100644 (file)
@@ -1,13 +1,13 @@
 /*****************************************************************************
  * mpeg_audio.c: parse MPEG audio sync info and packetize the stream
  *****************************************************************************
- * Copyright (C) 2001-2003 VideoLAN
+ * Copyright (C) 2001-2003 the VideoLAN team
  * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
  *          Christophe Massiot <massiot@via.ecp.fr>
- *          Gildas Bazin <gbazin@netcourrier.com>
+ *          Gildas Bazin <gbazin@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * 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.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
 #include <vlc/vlc.h>
-#include <vlc/decoder.h>
-#include <vlc/aout.h>
+#include <vlc_codec.h>
+#include <vlc_aout.h>
 
-#include "vlc_block_helper.h"
+#include <vlc_block_helper.h>
 
 /*****************************************************************************
  * decoder_sys_t : decoder descriptor
@@ -103,9 +103,11 @@ static int SyncInfo( uint32_t i_header, unsigned int * pi_channels,
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    set_description( _("MPEG audio layer I/II/III parser") );
-#if defined(SYS_DARWIN)
-    set_capability( "decoder", 5 );
+    set_description( _("MPEG audio layer I/II/III decoder") );
+    set_category( CAT_INPUT );
+    set_subcategory( SUBCAT_INPUT_ACODEC );
+#if defined(UNDER_CE)
+   set_capability( "decoder", 5 );
 #else
     set_capability( "decoder", 100 );
 #endif
@@ -130,6 +132,13 @@ static int OpenDecoder( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    /* HACK: Don't use this codec if we don't have an mpga audio filter */
+    if( p_dec->i_object_type == VLC_OBJECT_DECODER &&
+        !config_FindModule( p_this, "mpgatofixed32" ) )
+    {
+        return VLC_EGENERIC;
+    }
+
     /* Allocate the memory needed to store the decoder's structure */
     if( ( p_dec->p_sys = p_sys =
           (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
@@ -194,7 +203,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         return NULL;
     }
 
-    if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
+    if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
     {
         p_sys->i_state = STATE_NOSYNC;
     }
@@ -464,7 +473,7 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
 
     if( p_dec->fmt_out.audio.i_rate != p_sys->i_rate )
     {
-        msg_Info( p_dec, "MPGA channels:%d samplerate:%d bitrate:%d",
+        msg_Dbg( p_dec, "MPGA channels:%d samplerate:%d bitrate:%d",
                   p_sys->i_channels, p_sys->i_rate, p_sys->i_bit_rate );
 
         aout_DateInit( &p_sys->end_date, p_sys->i_rate );
@@ -481,7 +490,7 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
     p_dec->fmt_out.audio.i_physical_channels =
         p_sys->i_channels_conf & AOUT_CHAN_PHYSMASK;
 
-    p_dec->fmt_out.i_bitrate = p_sys->i_bit_rate;
+    p_dec->fmt_out.i_bitrate = p_sys->i_bit_rate * 1000;
 
     if( p_sys->b_packetizer )
     {