]> git.sesse.net Git - vlc/blobdiff - modules/codec/mpeg_audio.c
* modules/codec/dvbsub.c: oops, small fix.
[vlc] / modules / codec / mpeg_audio.c
index 0aafe67b533d288c656179609823febc9fde86ed..fd3c8ed944860f4f9b7be255ded2373b21b4fab6 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_audio.c: parse MPEG audio sync info and packetize the stream
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: mpeg_audio.c,v 1.23 2003/11/16 22:54:12 gbazin Exp $
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>                                              /* strdup() */
-
 #include <vlc/vlc.h>
 #include <vlc/decoder.h>
-#include <vlc/input.h>
 #include <vlc/aout.h>
-#include <vlc/sout.h>
 
 #include "vlc_block_helper.h"
 
@@ -109,7 +104,11 @@ static int SyncInfo( uint32_t i_header, unsigned int * pi_channels,
  *****************************************************************************/
 vlc_module_begin();
     set_description( _("MPEG audio layer I/II/III parser") );
+#if defined(SYS_DARWIN)
+    set_capability( "decoder", 5 );
+#else
     set_capability( "decoder", 100 );
+#endif
     set_callbacks( OpenDecoder, CloseDecoder );
 
     add_submodule();
@@ -148,6 +147,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
     p_dec->fmt_out.i_codec = VLC_FOURCC('m','p','g','a');
+    p_dec->fmt_out.audio.i_rate = 0; /* So end_date gets initialized */
 
     /* Set callback */
     p_dec->pf_decode_audio = (aout_buffer_t *(*)(decoder_t *, block_t **))
@@ -194,7 +194,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         return NULL;
     }
 
-    if( (*pp_block)->b_discontinuity )
+    if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
     {
         p_sys->i_state = STATE_NOSYNC;
     }
@@ -261,7 +261,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
             if( p_sys->i_frame_size == -1 )
             {
-                msg_Dbg( p_dec, "emulated start code" );
+                msg_Dbg( p_dec, "emulated startcode" );
                 block_SkipByte( &p_sys->bytestream );
                 p_sys->i_state = STATE_NOSYNC;
                 break;
@@ -335,7 +335,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                 if( i_next_frame_size == -1 )
                 {
-                    msg_Dbg( p_dec, "emulated start code on next frame" );
+                    msg_Dbg( p_dec, "emulated startcode on next frame" );
                     block_SkipByte( &p_sys->bytestream );
                     p_sys->i_state = STATE_NOSYNC;
                     break;
@@ -481,7 +481,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 )
     {