]> git.sesse.net Git - vlc/blobdiff - plugins/mpeg/input_es.c
Fixed a cosmetic issue.
[vlc] / plugins / mpeg / input_es.c
index 13f6668309d92ce8e8b2fdc9982632e787be08e9..49b118f8f74a8be5d515b3d55c04ffbaddf0bcbf 100644 (file)
@@ -2,7 +2,7 @@
  * input_es.c: Elementary Stream demux and packet management
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: input_es.c,v 1.13 2001/11/25 22:52:21 gbazin Exp $
+ * $Id: input_es.c,v 1.16.2.1 2001/12/10 15:56:57 massiot Exp $
  *
  * Author: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -48,8 +48,8 @@
 #   include <sys/uio.h>                                      /* struct iovec */
 #endif
 
-#include "config.h"
 #include "common.h"
+#include "intf_msg.h"
 #include "threads.h"
 #include "mtime.h"
 #include "tests.h"
 #   include "input_iovec.h"
 #endif
 
-#include "intf_msg.h"
-
-#include "main.h"
-
 #include "modules.h"
 #include "modules_export.h"
 
 static int  ESProbe     ( probedata_t * );
 static int  ESRead      ( struct input_thread_s *,
                           data_packet_t * p_packets[INPUT_READ_ONCE] );
-static void ESInit      ( struct input_thread_s * );
-static void ESEnd       ( struct input_thread_s * );
-static void ESSeek      ( struct input_thread_s *, off_t );
-static void ESDemux     ( struct input_thread_s *, struct data_packet_s * );
+static void ESInit          ( struct input_thread_s * );
+static void ESEnd           ( struct input_thread_s * );
+static void ESSeek          ( struct input_thread_s *, off_t );
+static int  ESSetProgram    ( struct input_thread_s *, pgrm_descriptor_t * );
+static void ESDemux         ( struct input_thread_s *, 
+                                struct data_packet_s * );
 static void ESNextDataPacket( struct bit_stream_s * );
 static void ESInitBitstream( struct bit_stream_s *, struct decoder_fifo_s *,
                         void (* pf_bitstream_callback)( struct bit_stream_s *,
@@ -105,6 +103,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
     input.pf_end              = ESEnd;
     input.pf_init_bit_stream  = ESInitBitstream;
     input.pf_set_area         = NULL;
+    input.pf_set_program      = ESSetProgram;
     input.pf_read             = ESRead;
     input.pf_demux            = ESDemux;
     input.pf_new_packet       = input_NetlistNewPacket;
@@ -202,6 +201,12 @@ static int ESRead( input_thread_t * p_input,
         return( -1 );
     }
 
+    /* EOF */
+    if( i_read == 0 && p_input->stream.b_seekable )
+    {
+        return( 1 );
+    }
+
     input_NetlistMviovec( p_input->p_method_data,
              (int)(i_read/ES_PACKET_SIZE), pp_packets );
 
@@ -220,6 +225,15 @@ static void ESSeek( input_thread_t * p_input, off_t i_position )
     p_input->stream.p_selected_area->i_tell = i_position;
 }
 
+
+/*****************************************************************************
+ * ESSetProgram: Does nothing
+ *****************************************************************************/
+static int ESSetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm )
+{
+    return( 0 );
+}
+
 /*****************************************************************************
  * ESDemux: fakes a demultiplexer
  *****************************************************************************/