* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
+ * $Id: input_programs.c,v 1.4 2000/12/19 19:08:51 massiot Exp $
*
* Authors:
*
switch( p_es->i_type )
{
- /* FIXME ! */
- case AC3_AUDIO_ES:
- p_es->thread_id = ac3dec_CreateThread( GetAdecConfig( p_input, p_es ) );
- break;
-
case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES:
p_es->thread_id = adec_CreateThread( GetAdecConfig( p_input, p_es ) );
p_es->thread_id = vpar_CreateThread( GetVdecConfig( p_input, p_es ) );
break;
+ case AC3_AUDIO_ES:
+ p_es->thread_id = ac3dec_CreateThread( GetAdecConfig( p_input, p_es ) );
+ break;
+
+ case DVD_SPU_ES:
+ p_es->thread_id = spudec_CreateThread( GetVdecConfig( p_input, p_es ) );
+ break;
+
default:
intf_ErrMsg( "Unknown stream type %d", p_es->i_type );
return( -1 );
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
+ * $Id: mpeg_system.c,v 1.9 2000/12/19 19:08:51 massiot Exp $
*
* Authors:
*
{
#define p_pes (p_es->p_pes)
- /* FIXME: since we don't check the type of the stream anymore, we don't
- * do the following : p_data->p_payload_start++; for DVD_SPU_ES, and
- * DVD SPU support is BROKEN ! */
-
if( p_es->p_decoder_fifo != NULL )
{
vlc_mutex_lock( &p_es->p_decoder_fifo->data_lock );
break;
}
+ if( p_es->i_stream_id == 0xBC )
+ {
+ /* With private stream 1, the first byte of the payload
+ * is a stream_private_id, so skip it. */
+ i_pes_header_size++;
+ }
+
/* Now we've parsed the header, we just have to indicate in some
* specific data packets where the PES payload begins (renumber
* p_payload_start), so that the decoders can find the beginning
* PS Demultiplexing
*/
+/*****************************************************************************
+ * GetID: Get the ID of a stream
+ *****************************************************************************/
+static u16 GetID( data_packet_t * p_data )
+{
+ u16 i_id;
+
+ i_id = p_data->p_buffer[3]; /* stream_id */
+ if( i_id == 0xBD )
+ {
+ /* stream_private_id */
+ i_id |= p_data->p_buffer[ 9 + p_data->p_buffer[8] ] << 8;
+ }
+ return( i_id );
+}
+
/*****************************************************************************
* DecodePSM: Decode the Program Stream Map information
*****************************************************************************/
int i_dummy;
/* This is a PES packet. Find out if we want it or not. */
- i_id = p_data->p_buffer[3]; /* ID of the stream. */
+ i_id = GetID( p_data );
vlc_mutex_lock( &p_input->stream.stream_lock );
+#if 1
+ for( i_dummy = 0; i_dummy < INPUT_MAX_ES; i_dummy++ )
+ {
+ if( p_input->p_es[i_dummy].i_id != EMPTY_ID
+ && p_input->p_es[i_dummy].i_id == i_id )
+ {
+ p_es = &p_input->p_es[i_dummy];
+ break;
+ }
+ }
+#else
for( i_dummy = 0; i_dummy < INPUT_MAX_SELECTED_ES; i_dummy++ )
{
if( p_input->pp_selected_es[i_dummy] != NULL
break;
}
}
+#endif
vlc_mutex_unlock( &p_input->stream.stream_lock );
if( p_es == NULL )
{
#if 1
- /* FIXME ! */
- if( (i_id & 0xC0L) == 0xC0L )
- {
- vlc_mutex_lock( &p_input->stream.stream_lock );
- /* MPEG video and audio */
- p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
- i_id, 0 );
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+ p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
+ i_id, 0 );
- if( p_es != NULL && (i_id & 0xF0L) == 0xE0L )
+ if( p_es != NULL )
+ {
+ if( (i_id & 0xF0) == 0xE0 )
{
/* MPEG video */
p_es->i_stream_id = i_id;
input_SelectES( p_input, p_es );
#endif
}
- else if( p_es != NULL && (i_id & 0xE0) == 0xC0 )
+ else if( (i_id & 0xE0) == 0xC0 )
{
/* MPEG audio */
p_es->i_stream_id = i_id;
p_es->i_type = MPEG2_AUDIO_ES;
+#ifdef AUTO_SPAWN
+ input_SelectES( p_input, p_es );
+#endif
+ }
+ else if( (i_id & 0xF0FF) == 0x80BD )
+ {
+ /* AC3 audio */
+ p_es->i_stream_id = 0xBD;
+ p_es->i_type = AC3_AUDIO_ES;
+
+#ifdef AUTO_SPAWN
+ input_SelectES( p_input, p_es );
+#endif
+ }
+ else if( (i_id & 0xF0FF) == 0x20BD )
+ {
+ /* Subtitles video */
+ p_es->i_stream_id = 0xBD;
+ p_es->i_type = DVD_SPU_ES;
+
#ifdef AUTO_SPAWN
input_SelectES( p_input, p_es );
#endif
#endif
}
- if( p_es != NULL )
+ if( p_es->p_decoder_fifo != NULL && !b_trash )
{
#ifdef STATS
p_es->c_packets++;