* 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>
*
# 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 *,
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;
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 );
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
*****************************************************************************/