]> git.sesse.net Git - vlc/blobdiff - modules/demux/a52sys.c
Some of RV32 bugs worked out - pretty close. Some RGB2 work.
[vlc] / modules / demux / a52sys.c
index 41c024180d1f77b7a6be60defad185cf124c9076..800267595c329e1977860a69c730eac5c75c5813 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
- * a52.c : Raw a52 Stream input module for vlc
+ * a52.c : Raw A/52 Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: a52sys.c,v 1.7 2003/11/11 00:37:59 fenrir Exp $
+ * $Id: a52sys.c,v 1.11 2003/12/22 02:24:52 sam Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -36,7 +36,7 @@ static int  Open    ( vlc_object_t * );
 static void Close  ( vlc_object_t * );
 
 vlc_module_begin();
-    set_description( _("A52 demuxer" ) );
+    set_description( _("A/52 demuxer" ) );
     set_capability( "demux", 100 );
     set_callbacks( Open, Close );
     add_shortcut( "a52" );
@@ -139,26 +139,15 @@ static int Open( vlc_object_t * p_this )
         goto error;
     }
 
+    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'a', '5', '2', ' ' ) );
     if( HeaderCheck( p_peek ) )
     {
-        int i_channels, i_sample_rate, i_frame_size;
-        input_info_category_t * p_category;
-
-        HeaderInfo( p_peek, &i_channels, &i_sample_rate, &i_frame_size );
-
-        msg_Dbg( p_input,
-                 "a52 channels=%d sample_rate=%d",
-                 i_channels, i_sample_rate );
-
-        vlc_mutex_lock( &p_input->stream.stream_lock );
+        int i_frame_size;
 
-        p_category = input_InfoCategory( p_input, _("A52") );
+        HeaderInfo( p_peek, &fmt.audio.i_channels, &fmt.audio.i_rate, &i_frame_size );
 
-        input_AddInfo( p_category, _("Input Type"), "A52" );
-        input_AddInfo( p_category, _("Channels"), "%d", i_channels );
-        input_AddInfo( p_category, _("Sample Rate"), "%dHz", i_sample_rate );
-
-        vlc_mutex_unlock( &p_input->stream.stream_lock );
+        msg_Dbg( p_input, "a52 channels=%d sample_rate=%d",
+                 fmt.audio.i_channels, fmt.audio.i_rate );
     }
 
     vlc_mutex_lock( &p_input->stream.stream_lock );
@@ -171,7 +160,6 @@ static int Open( vlc_object_t * p_this )
     p_input->stream.i_mux_rate = 0 / 50;
     vlc_mutex_unlock( &p_input->stream.stream_lock );
 
-    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'a', '5', '2', ' ' ) );
     p_sys->p_es = es_out_Add( p_input->p_es_out, &fmt );
     return VLC_SUCCESS;
 
@@ -189,7 +177,7 @@ error:
 static int Demux( input_thread_t * p_input )
 {
     demux_sys_t  *p_sys = p_input->p_demux_data;
-    pes_packet_t *p_pes;
+    block_t *p_block;
 
     int i_channels, i_sample_rate, i_frame_size;
 
@@ -239,18 +227,18 @@ static int Demux( input_thread_t * p_input )
                           p_input->stream.p_selected_program,
                           p_sys->i_time * 9 / 100 );
 
-    if( ( p_pes = stream_PesPacket( p_input->s, i_frame_size ) ) == NULL )
+    if( ( p_block = stream_Block( p_input->s, i_frame_size ) ) == NULL )
     {
         msg_Warn( p_input, "cannot read data" );
         return 0;
     }
 
-    p_pes->i_dts =
-    p_pes->i_pts = input_ClockGetTS( p_input,
+    p_block->i_dts =
+    p_block->i_pts = input_ClockGetTS( p_input,
                                      p_input->stream.p_selected_program,
                                      p_sys->i_time * 9 / 100 );
 
-    es_out_Send( p_input->p_es_out, p_sys->p_es, p_pes );
+    es_out_Send( p_input->p_es_out, p_sys->p_es, p_block );
 
     p_sys->i_time += (mtime_t)1000000 *
                      (mtime_t)1536 /