]> git.sesse.net Git - vlc/blobdiff - modules/demux/aac.c
* include/input_ext-intf.h : added stream_t member to input_thread_t.
[vlc] / modules / demux / aac.c
index 1b21f11ae1cc1a5c7794dfc59447994cde10f116..10001af0a64b9ac4efe5dcb3d3e79eb0fc8dc675 100644 (file)
@@ -2,7 +2,7 @@
  * aac.c : Raw aac Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: aac.c,v 1.3 2003/09/07 22:48:29 fenrir Exp $
+ * $Id: aac.c,v 1.4 2003/09/12 16:26:40 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -54,7 +54,6 @@ static int  Demux       ( input_thread_t * );
 
 struct demux_sys_t
 {
-    stream_t        *s;
     mtime_t         i_time;
 
     es_descriptor_t *p_es;
@@ -139,14 +138,8 @@ static int Open( vlc_object_t * p_this )
     p_input->p_demux_data = p_sys = malloc( sizeof( demux_sys_t ) );
     p_sys->i_time = 0;
 
-    if( ( p_sys->s = stream_OpenInput( p_input ) ) == NULL )
-    {
-        msg_Err( p_input, "cannot create stream" );
-        goto error;
-    }
-
     /* peek the begining (10 is for adts header) */
-    if( stream_Peek( p_sys->s, &p_peek, 10 ) < 10 )
+    if( stream_Peek( p_input->s, &p_peek, 10 ) < 10 )
     {
         msg_Err( p_input, "cannot peek" );
         goto error;
@@ -213,10 +206,6 @@ static int Open( vlc_object_t * p_this )
     return VLC_SUCCESS;
 
 error:
-    if( p_sys->s )
-    {
-        stream_Release( p_sys->s );
-    }
     free( p_sys );
     return VLC_EGENERIC;
 }
@@ -235,7 +224,7 @@ static int Demux( input_thread_t * p_input )
     uint8_t      h[8];
     uint8_t      *p_peek;
 
-    if( stream_Peek( p_sys->s, &p_peek, 8 ) < 8 )
+    if( stream_Peek( p_input->s, &p_peek, 8 ) < 8 )
     {
         msg_Warn( p_input, "cannot peek" );
         return 0;
@@ -248,7 +237,7 @@ static int Demux( input_thread_t * p_input )
         int         i_skip = 0;
         int         i_peek;
 
-        i_peek = stream_Peek( p_sys->s, &p_peek, 8096 );
+        i_peek = stream_Peek( p_input->s, &p_peek, 8096 );
         if( i_peek < 8 )
         {
             msg_Warn( p_input, "cannot peek" );
@@ -269,7 +258,7 @@ static int Demux( input_thread_t * p_input )
         }
 
         msg_Warn( p_input, "garbage=%d bytes", i_skip );
-        stream_Read( p_sys->s, NULL, i_skip );
+        stream_Read( p_input->s, NULL, i_skip );
         return 1;
     }
 
@@ -279,7 +268,7 @@ 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_sys->s, AAC_FRAME_SIZE( h ) ) ) == NULL )
+    if( ( p_pes = stream_PesPacket( p_input->s, AAC_FRAME_SIZE( h ) ) )==NULL )
     {
         msg_Warn( p_input, "cannot read data" );
         return 0;
@@ -312,10 +301,6 @@ static void Close( vlc_object_t * p_this )
     input_thread_t *p_input = (input_thread_t*)p_this;
     demux_sys_t    *p_sys = p_input->p_demux_data;
 
-    if( p_sys->s )
-    {
-        stream_Release( p_sys->s );
-    }
     free( p_sys );
 }