From: Johan Bilien Date: Wed, 5 Dec 2001 03:31:04 +0000 (+0000) Subject: * Added 2 fields, p_selected_program and p_new_program, to the X-Git-Tag: 0.3.0~348 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=dbbc910fbb8a2e5897be4388b95c0f56aa168cc6;p=vlc * Added 2 fields, p_selected_program and p_new_program, to the input_thread_t structure, so that we may support multi programs streams. * Modified inputs to take account of this change. * Modified input_clock.c so that it doesn't refer to pp_programs[0] any more. Now we should not refer to the first program, but to the selected program. Functions to change the current program are coming. --- diff --git a/include/input_ext-intf.h b/include/input_ext-intf.h index 898bcef269..d91ca0c10a 100644 --- a/include/input_ext-intf.h +++ b/include/input_ext-intf.h @@ -4,7 +4,7 @@ * control the pace of reading. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: input_ext-intf.h,v 1.49 2001/11/25 22:52:21 gbazin Exp $ + * $Id: input_ext-intf.h,v 1.50 2001/12/05 03:31:04 jobi Exp $ * * Authors: Christophe Massiot * @@ -207,7 +207,9 @@ typedef struct stream_descriptor_s /* Programs descriptions */ int i_pgrm_number; /* size of the following array */ pgrm_descriptor_t ** pp_programs; /* array of pointers to pgrm */ - + pgrm_descriptor_t * p_selected_program; /* currently + selected program */ + pgrm_descriptor_t * p_new_program; /* Newly selected program */ /* ES descriptions */ int i_es_number; es_descriptor_t ** pp_es; /* carried elementary streams */ diff --git a/plugins/dvd/input_dvd.c b/plugins/dvd/input_dvd.c index 50c4b93881..6626b1ff57 100644 --- a/plugins/dvd/input_dvd.c +++ b/plugins/dvd/input_dvd.c @@ -10,7 +10,7 @@ * -dvd_udf to find files ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: input_dvd.c,v 1.102 2001/11/28 15:08:05 massiot Exp $ + * $Id: input_dvd.c,v 1.103 2001/12/05 03:31:04 jobi Exp $ * * Author: Stéphane Borel * @@ -543,23 +543,25 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) } free( p_input->stream.pp_selected_es ); - input_DelProgram( p_input, p_input->stream.pp_programs[0] ); + input_DelProgram( p_input, p_input->stream.p_selected_program ); p_input->stream.pp_selected_es = NULL; p_input->stream.i_selected_es_number = 0; } input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) ); + p_input->stream.p_selected_program = p_input->stream.pp_programs[0]; /* No PSM to read in DVD mode, we already have all information */ - p_input->stream.pp_programs[0]->b_is_ok = 1; + p_input->stream.p_selected_program->b_is_ok = 1; p_es = NULL; /* ES 0 -> video MPEG2 */ IfoPrintVideo( p_dvd ); - p_es = input_AddES( p_input, p_input->stream.pp_programs[0], 0xe0, 0 ); + p_es = input_AddES( p_input, p_input->stream.p_selected_program, + 0xe0, 0 ); p_es->i_stream_id = 0xe0; p_es->i_type = MPEG2_VIDEO_ES; p_es->i_cat = VIDEO_ES; @@ -585,7 +587,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) case 0x00: /* AC3 */ i_id = ( ( 0x80 + audio_status.i_position ) << 8 ) | 0xbd; p_es = input_AddES( p_input, - p_input->stream.pp_programs[0], i_id, 0 ); + p_input->stream.p_selected_program, i_id, 0 ); p_es->i_stream_id = 0xbd; p_es->i_type = AC3_AUDIO_ES; p_es->b_audio = 1; @@ -599,7 +601,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) case 0x03: /* MPEG audio */ i_id = 0xc0 + audio_status.i_position; p_es = input_AddES( p_input, - p_input->stream.pp_programs[0], i_id, 0 ); + p_input->stream.p_selected_program, i_id + , 0 ); p_es->i_stream_id = i_id; p_es->i_type = MPEG2_AUDIO_ES; p_es->b_audio = 1; @@ -613,7 +616,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) i_id = ( ( 0xa0 + audio_status.i_position ) << 8 ) | 0xbd; p_es = input_AddES( p_input, - p_input->stream.pp_programs[0], i_id, 0 ); + p_input->stream.p_selected_program, + i_id, 0 ); p_es->i_stream_id = 0xbd; p_es->i_type = LPCM_AUDIO_ES; p_es->b_audio = 1; @@ -676,7 +680,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) | 0xbd; } p_es = input_AddES( p_input, - p_input->stream.pp_programs[0], i_id, 0 ); + p_input->stream.p_selected_program, + i_id, 0 ); p_es->i_stream_id = 0xbd; p_es->i_type = DVD_SPU_ES; p_es->i_cat = SPU_ES; diff --git a/plugins/mpeg/input_ps.c b/plugins/mpeg/input_ps.c index 88c64311d3..e96d5d38d7 100644 --- a/plugins/mpeg/input_ps.c +++ b/plugins/mpeg/input_ps.c @@ -2,7 +2,7 @@ * input_ps.c: PS demux and packet management ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: input_ps.c,v 1.41 2001/12/03 17:55:45 massiot Exp $ + * $Id: input_ps.c,v 1.42 2001/12/05 03:31:04 jobi Exp $ * * Authors: Christophe Massiot * Cyril Deguet @@ -234,7 +234,12 @@ static void PSInit( input_thread_t * p_input ) /* FIXME : detect if InitStream failed */ input_InitStream( p_input, sizeof( stream_ps_data_t ) ); input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) ); - + + p_input->stream.p_selected_program = + p_input->stream.pp_programs[0] ; + p_input->stream.p_new_program = + p_input->stream.pp_programs[0] ; + if( p_input->stream.b_seekable ) { stream_ps_data_t * p_demux_data = diff --git a/plugins/vcd/input_vcd.c b/plugins/vcd/input_vcd.c index 404674ec01..fc37b177d9 100644 --- a/plugins/vcd/input_vcd.c +++ b/plugins/vcd/input_vcd.c @@ -361,12 +361,13 @@ static void VCDInit( input_thread_t * p_input ) /* Set program information. */ - input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) ); + input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) ); + p_input->stream.p_selected_program = p_input->stream.pp_programs[0]; /* No PSM to read in disc mode, we already have all information */ - p_input->stream.pp_programs[0]->b_is_ok = 1; + p_input->stream.p_selected_program->b_is_ok = 1; - p_es = input_AddES( p_input, p_input->stream.pp_programs[0], 0xe0, 0 ); + p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xe0, 0 ); p_es->i_stream_id = 0xe0; p_es->i_type = MPEG1_VIDEO_ES; p_es->i_cat = VIDEO_ES; @@ -377,7 +378,7 @@ static void VCDInit( input_thread_t * p_input ) } p_es = input_AddES( p_input, - p_input->stream.pp_programs[0], 0xc0, 0 ); + p_input->stream.p_selected_program, 0xc0, 0 ); p_es->i_stream_id = 0xc0; p_es->i_type = MPEG1_AUDIO_ES; p_es->b_audio = 1; diff --git a/src/input/input_clock.c b/src/input/input_clock.c index 9b24f651b4..b72b7db528 100644 --- a/src/input/input_clock.c +++ b/src/input/input_clock.c @@ -2,7 +2,7 @@ * input_clock.c: Clock/System date convertions, stream management ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_clock.c,v 1.24 2001/11/28 15:08:06 massiot Exp $ + * $Id: input_clock.c,v 1.25 2001/12/05 03:31:04 jobi Exp $ * * Authors: Christophe Massiot * @@ -232,7 +232,7 @@ void input_ClockManageRef( input_thread_t * p_input, p_pgrm->i_synchro_state = SYNCHRO_OK; if( p_input->stream.b_pace_control - && p_input->stream.pp_programs[0] == p_pgrm ) + && p_input->stream.p_selected_program == p_pgrm ) { p_pgrm->last_cr = i_clock; mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) ); @@ -263,7 +263,7 @@ void input_ClockManageRef( input_thread_t * p_input, p_pgrm->last_cr = i_clock; if( p_input->stream.b_pace_control - && p_input->stream.pp_programs[0] == p_pgrm ) + && p_input->stream.p_selected_program == p_pgrm ) { /* We remember the last system date to be able to restart * the synchro we statistically better continuity, after diff --git a/src/input/input_programs.c b/src/input/input_programs.c index 78e2378ee7..5fdcd7b220 100644 --- a/src/input/input_programs.c +++ b/src/input/input_programs.c @@ -2,7 +2,7 @@ * input_programs.c: es_descriptor_t, pgrm_descriptor_t management ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_programs.c,v 1.66 2001/11/28 15:08:06 massiot Exp $ + * $Id: input_programs.c,v 1.67 2001/12/05 03:31:04 jobi Exp $ * * Authors: Christophe Massiot * @@ -65,7 +65,9 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len ) p_input->stream.p_removed_es = NULL; p_input->stream.p_newly_selected_es = NULL; p_input->stream.pp_programs = NULL; - + p_input->stream.p_selected_program = NULL; + p_input->stream.p_new_program = NULL; + if( i_data_len ) { if ( (p_input->stream.p_demux_data = malloc( i_data_len )) == NULL ) diff --git a/src/input/mpeg_system.c b/src/input/mpeg_system.c index 223529ffac..f655227b31 100644 --- a/src/input/mpeg_system.c +++ b/src/input/mpeg_system.c @@ -2,7 +2,7 @@ * mpeg_system.c: TS, PS and PES management ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: mpeg_system.c,v 1.67 2001/12/03 17:55:45 massiot Exp $ + * $Id: mpeg_system.c,v 1.68 2001/12/05 03:31:04 jobi Exp $ * * Authors: Christophe Massiot * Michel Lespinasse @@ -1378,6 +1378,8 @@ static void input_DecodePAT( input_thread_t * p_input, es_descriptor_t * p_es ) } #undef p_psi + /* FIXME This has nothing to do here */ + p_input->stream.p_selected_program = p_input->stream.pp_programs[0] ; }