]> git.sesse.net Git - vlc/commitdiff
* Added 2 fields, p_selected_program and p_new_program, to the
authorJohan Bilien <jobi@videolan.org>
Wed, 5 Dec 2001 03:31:04 +0000 (03:31 +0000)
committerJohan Bilien <jobi@videolan.org>
Wed, 5 Dec 2001 03:31:04 +0000 (03:31 +0000)
  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.

include/input_ext-intf.h
plugins/dvd/input_dvd.c
plugins/mpeg/input_ps.c
plugins/vcd/input_vcd.c
src/input/input_clock.c
src/input/input_programs.c
src/input/mpeg_system.c

index 898bcef269a36e3f67cddf0e16d694864a81f632..d91ca0c10a14582e9ab1ce10c8c2eb0b94ebe8b9 100644 (file)
@@ -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 <massiot@via.ecp.fr>
  *
@@ -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 */
index 50c4b93881c0e26de588a4b0d11938b70f1c1cf9..6626b1ff57c70d283fdbd490949c9c53294cfc97 100644 (file)
@@ -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 <stef@via.ecp.fr>
  *
@@ -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;
index 88c64311d36b07c57e283c515d9bf85d95e30991..e96d5d38d70c5ede7d9aed3f68e0eaba1a1bad82 100644 (file)
@@ -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 <massiot@via.ecp.fr>
  *          Cyril Deguet <asmax@via.ecp.fr>
@@ -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 =
index 404674ec016286b9c0a914d6f9172278587c1269..fc37b177d928a52d2b6516029c6efdbfeb8b1b8e 100644 (file)
@@ -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;
index 9b24f651b447d335826cc9d99f38b0b819a4dd1d..b72b7db528336b0e1bd1dc5ce79c98acc4c3eb95 100644 (file)
@@ -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 <massiot@via.ecp.fr>
  *
@@ -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 
index 78e2378ee723788a20430d20c8254085689b25b5..5fdcd7b220ff619fe47110407b76578113bc543f 100644 (file)
@@ -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 <massiot@via.ecp.fr>
  *
@@ -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 )
index 223529ffacf52543f9666feb93a2fc9a97ab3416..f655227b3183b50f168218bd644b6e7d3a24b89f 100644 (file)
@@ -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 <massiot@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -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] ;
 
 }