]> git.sesse.net Git - vlc/commitdiff
* Dvd angle is now handled through a program structure, so that the interface
authorStéphane Borel <stef@videolan.org>
Tue, 5 Mar 2002 17:46:33 +0000 (17:46 +0000)
committerStéphane Borel <stef@videolan.org>
Tue, 5 Mar 2002 17:46:33 +0000 (17:46 +0000)
needs nothing specific to change angle.

* Fixed a bug in clock management where ES without a program couldn't get
timestamped.

*Fixed program management in gnome/gtk. Program now also appears in popup.

*In interface, only display ES associated with the selected program, or with
no program at all.

15 files changed:
include/input_ext-intf.h
plugins/dvd/dvd_summary.c
plugins/dvd/input_dvd.c
plugins/dvdread/input_dvdread.c
plugins/gtk/gnome.glade
plugins/gtk/gnome_interface.c
plugins/gtk/gtk.glade
plugins/gtk/gtk_common.h
plugins/gtk/gtk_display.c
plugins/gtk/gtk_interface.c
plugins/gtk/gtk_menu.c
src/input/input_clock.c
src/input/input_ext-intf.c
src/input/input_programs.c
src/input/mpeg_system.c

index 3f24764059f4d7ebd6dbb368a294456a5556b331..c7d9042fbc13198410f9a74b83f311a0f76847a2 100644 (file)
@@ -4,7 +4,7 @@
  * control the pace of reading. 
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.61 2002/03/01 00:33:17 massiot Exp $
+ * $Id: input_ext-intf.h,v 1.62 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -174,8 +174,6 @@ typedef struct input_area_s
     int                     i_part_nb;   /* number of parts (chapter for DVD)*/
     int                     i_part;      /* currently selected part */
 
-    int                     i_angle_nb;  /* number of angles/title units */
-    int                     i_angle;
 
     /* offset to plugin related data */
     off_t                   i_plugin_data;
index 2fb4764a8d63dc4744f256b5a53d5544d16b1ce6..125d428131e1778ce90570a0d68d231cd33987d9 100644 (file)
@@ -3,7 +3,7 @@
  * found in .ifo.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_summary.c,v 1.12 2001/12/30 07:09:55 sam Exp $
+ * $Id: dvd_summary.c,v 1.13 2002/03/05 17:46:33 stef Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -98,8 +98,8 @@ void IfoPrintVideo( thread_dvd_data_t * p_dvd )
                 "352x240 ntsc or 352x288 pal"
              };
 
-    intf_WarnMsg( 5, "dvd info: MPEG-%d video, %sHz, aspect ratio %s"
-                     "display mode %s", video.i_compression + 1,
+    intf_WarnMsg( 5, "dvd info: MPEG-%d video, %sHz, aspect ratio %s",
+                     video.i_compression + 1,
                      video.i_system ? "pal 625 @50" : "ntsc 525 @60",
                      video.i_ratio ? (video.i_ratio == 3) ? "16:9"
                                                           : "unknown"
index 766d2c14f7238922002ccb8372815ebcad3a9fe4..b9e7c08ad8c87aab406d3529f7300a27be921f82 100644 (file)
@@ -8,7 +8,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.131 2002/03/05 00:50:37 stef Exp $
+ * $Id: input_dvd.c,v 1.132 2002/03/05 17:46:33 stef Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -237,19 +237,6 @@ static int DVDRewind( input_thread_t * p_input )
  * Data access functions
  */
 
-#define PARSE( chr, action )                            \
-    psz_parser = p_input->psz_name;                     \
-    while( *(psz_parser) && *(psz_parser) != (chr) )    \
-    {                                                   \
-        (psz_parser)++;                                 \
-    }                                                   \
-                                                        \
-    if( *(psz_parser) == (chr) )                        \
-    {                                                   \
-        *(psz_parser) = '\0';                           \
-        (action);                                       \
-    }
-
 /*****************************************************************************
  * DVDOpen: open dvd
  *****************************************************************************/
@@ -483,10 +470,6 @@ static int DVDOpen( struct input_thread_s *p_input )
     p_dvd->dvdhandle = (dvdcss_handle) dvdhandle;
     p_input->p_access_data = (void *)p_dvd;
 
-    p_dvd->i_title = i_title;
-    p_dvd->i_chapter = i_chapter;
-    p_dvd->i_angle = i_angle;
-
     if( dvdcss_seek( p_dvd->dvdhandle, 0, DVDCSS_NOFLAGS ) < 0 )
     {
         intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) );
@@ -538,19 +521,22 @@ static int DVDOpen( struct input_thread_s *p_input )
         area[i]->i_part_nb = title_inf.p_attr[i-1].i_chapter_nb;
         area[i]->i_part = 1;
 
-        /* Number of angles */
-        area[i]->i_angle_nb = 0;
-        area[i]->i_angle = 1;
-
         /* Offset to vts_i_0.ifo */
         area[i]->i_plugin_data = p_dvd->p_ifo->i_start +
                        title_inf.p_attr[i-1].i_start_sector;
     }   
 #undef area
+    
+    p_dvd->i_title = i_title <= title_inf.i_title_nb ? i_title : 1;
 #undef title_inf
 
-    p_area = p_input->stream.pp_areas[i_title];
-    p_area->i_part = i_chapter;
+
+    p_area = p_input->stream.pp_areas[p_dvd->i_title];
+    
+    p_dvd->i_chapter = i_chapter < p_area->i_part_nb ? i_chapter : 1;
+    p_area->i_part = p_dvd->i_chapter;
+    
+    p_dvd->i_angle = i_angle;
 
     /* set title, chapter, audio and subpic */
     if( DVDSetArea( p_input, p_area ) )
@@ -586,9 +572,44 @@ static void DVDClose( struct input_thread_s *p_input )
 /*****************************************************************************
  * DVDSetProgram: Does nothing, a DVD is mono-program
  *****************************************************************************/
-static int DVDSetProgram( input_thread_t * p_input, 
-            pgrm_descriptor_t * p_program ) 
+static int DVDSetProgram( input_thread_t    * p_input,
+                          pgrm_descriptor_t * p_program ) 
 {
+    if( p_input->stream.p_selected_program != p_program )
+    {
+        thread_dvd_data_t *  p_dvd;
+        int                  i_angle;
+    
+        p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+        i_angle = p_program->i_number;
+
+        memcpy( p_program, p_input->stream.p_selected_program,
+                sizeof(pgrm_descriptor_t) );
+        p_program->i_number = i_angle;
+        p_input->stream.p_selected_program = p_program;
+
+#define title \
+    p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
+        if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
+        {
+            if( ( p_program->i_number - p_dvd->i_angle ) < 0 )
+            {
+                p_dvd->i_cell = 0;
+            }
+            p_dvd->i_prg_cell += ( p_program->i_number - p_dvd->i_angle );
+            p_dvd->i_angle = p_program->i_number;
+    
+            DVDFindSector( p_dvd );
+            p_dvd->i_cell += p_dvd->i_angle_cell;
+        }
+        else
+        {
+            p_dvd->i_angle = p_program->i_number;
+        }
+#undef title
+        intf_WarnMsg( 3, "dvd info: angle %d selected", p_dvd->i_angle );
+    }
+
     return 0;
 }
 
@@ -716,8 +737,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
         /* Area definition */
         p_input->stream.p_selected_area->i_start = LB2OFF( p_dvd->i_start );
         p_input->stream.p_selected_area->i_size = LB2OFF( p_dvd->i_size );
-        p_input->stream.p_selected_area->i_angle_nb = p_dvd->i_angle_nb;
-        p_input->stream.p_selected_area->i_angle = p_dvd->i_angle;
 
 #if 0
         /* start at the beginning of the title */
@@ -728,7 +747,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
 #endif
 
         /*
-         * Destroy obsolete ES by reinitializing program 0
+         * Destroy obsolete ES by reinitializing programs
          * and find all ES in title with ifo data
          */
         if( p_input->stream.pp_programs != NULL )
@@ -736,21 +755,45 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
             /* We don't use input_EndStream here since
              * we keep area structures */
 
+            /* Unselect all ES */
+            /*
             for( i = 0 ; i < p_input->stream.i_selected_es_number ; i++ )
             {
                 input_UnselectES( p_input, p_input->stream.pp_selected_es[i] );
             }
+*/
+            
+            for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
+            {
+                input_DelES( p_input, p_input->stream.pp_es[i] );
+            }
+            
+            for( i = 0 ; i < p_input->stream.i_pgrm_number ; i++ )
+            {
+                input_DelProgram( p_input, p_input->stream.pp_programs[i] );
+            }
 
-            free( p_input->stream.pp_selected_es );
-            input_DelProgram( p_input, p_input->stream.p_selected_program );
-
-            p_input->stream.pp_selected_es = NULL;
+            if( p_input->stream.pp_selected_es )
+            {
+                free( p_input->stream.pp_selected_es );
+                p_input->stream.pp_selected_es = NULL;
+            }
             p_input->stream.i_selected_es_number = 0;
         }
+        
+        /* angle */
 
-        input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
+        input_AddProgram( p_input, 1, 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]; 
+
+        for( i = 1 ; i < p_dvd->i_angle_nb ; i++ )
+        {
+            input_AddProgram( p_input, i+1, 0 );
+        }
+        
+        DVDSetProgram( p_input,
+                       p_input->stream.pp_programs[p_dvd->i_angle-1] ); 
+        
 
         /* No PSM to read in DVD mode, we already have all information */
         p_input->stream.p_selected_program->b_is_ok = 1;
@@ -760,8 +803,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
         /* ES 0 -> video MPEG2 */
         IfoPrintVideo( p_dvd );
 
-        p_es = input_AddES( p_input, p_input->stream.p_selected_program, 
-                0xe0, 0 );
+        p_es = input_AddES( p_input, NULL, 0xe0, 0 );
         p_es->i_stream_id = 0xe0;
         p_es->i_type = MPEG2_VIDEO_ES;
         p_es->i_cat = VIDEO_ES;
@@ -782,8 +824,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.p_selected_program, i_id, 0 );
+                    p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = 0xbd;
                     p_es->i_type = AC3_AUDIO_ES;
                     p_es->b_audio = 1;
@@ -796,9 +837,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
                 case 0x02:
                 case 0x03:              /* MPEG audio */
                     i_id = 0xc0 + audio_status.i_position;
-                    p_es = input_AddES( p_input,
-                                    p_input->stream.p_selected_program, i_id
-                                    , 0 );
+                    p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = i_id;
                     p_es->i_type = MPEG2_AUDIO_ES;
                     p_es->b_audio = 1;
@@ -811,9 +850,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
                 case 0x04:              /* LPCM */
     
                     i_id = ( ( 0xa0 + audio_status.i_position ) << 8 ) | 0xbd;
-                    p_es = input_AddES( p_input,
-                                    p_input->stream.p_selected_program,
-                                    i_id, 0 );
+                    p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = 0xbd;
                     p_es->i_type = LPCM_AUDIO_ES;
                     p_es->b_audio = 1;
@@ -875,9 +912,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
                     i_id = ( ( 0x20 + spu_status.i_position_43 ) << 8 )
                            | 0xbd;
                 }
-                p_es = input_AddES( p_input,
-                                    p_input->stream.p_selected_program,
-                                    i_id, 0 );
+                p_es = input_AddES( p_input, NULL, i_id, 0 );
                 p_es->i_stream_id = 0xbd;
                 p_es->i_type = DVD_SPU_ES;
                 p_es->i_cat = SPU_ES;
@@ -934,27 +969,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
 
 #define title \
     p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
-    if( p_area->i_angle != p_dvd->i_angle )
-    {
-        if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
-        {
-            if( ( p_area->i_angle - p_dvd->i_angle ) < 0 )
-            {
-                p_dvd->i_cell = 0;
-            }
-            p_dvd->i_prg_cell += ( p_area->i_angle - p_dvd->i_angle );
-            p_dvd->i_angle = p_area->i_angle;
-    
-            DVDFindSector( p_dvd );
-            p_dvd->i_cell += p_dvd->i_angle_cell;
-        }
-        else
-        {
-            p_dvd->i_angle = p_area->i_angle;
-        }
-
-        intf_WarnMsg( 3, "dvd info: angle %d selected", p_area->i_angle );
-    }
 
     /* warn interface that something has changed */
     p_input->stream.b_seekable = 1;
index 6022b1a46fc7b8f380b5760025f64edfb12ea9d5..13b1331180bcaa619c8ddf63dad043cd5022eb17 100644 (file)
@@ -6,7 +6,7 @@
  * It depends on: libdvdread for ifo files and block reading.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: input_dvdread.c,v 1.28 2002/03/05 00:50:37 stef Exp $
+ * $Id: input_dvdread.c,v 1.29 2002/03/05 17:46:33 stef Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -338,9 +338,6 @@ static int DvdReadOpen( struct input_thread_s *p_input )
     p_dvd->p_title = NULL;
     p_dvd->p_vts_file = NULL;
 
-    p_dvd->i_title = i_title;
-    p_dvd->i_chapter = i_chapter;
-    p_dvd->i_angle = i_angle;
 
     p_input->p_access_data = (void *)p_dvd;
 
@@ -394,18 +391,20 @@ static int DvdReadOpen( struct input_thread_s *p_input )
         area[i]->i_part_nb = tt_srpt->title[i-1].nr_of_ptts;
         area[i]->i_part = 1;
 
-        /* Number of angles */
-        area[i]->i_angle_nb = 0;
-        area[i]->i_angle = 1;
-
         area[i]->i_plugin_data = tt_srpt->title[i-1].title_set_nr;
     }
 #undef area
+
+    p_dvd->i_title = i_title <= tt_srpt->nr_of_srpts ? i_title : 1;
 #undef tt_srpt
 
-    p_input->stream.pp_areas[i_title]->i_part = i_chapter;
+    p_area = p_input->stream.pp_areas[p_dvd->i_title];
+    p_dvd->i_chapter = i_chapter;
 
-    p_area = p_input->stream.pp_areas[i_title];
+    p_dvd->i_chapter = i_chapter < p_area->i_part_nb ? i_chapter : 1;
+    p_area->i_part = p_dvd->i_chapter;
+    
+    p_dvd->i_angle = i_angle;
 
     /* set title, chapter, audio and subpic */
     if( DvdReadSetArea( p_input, p_area ) )
@@ -445,6 +444,21 @@ static void DvdReadClose( struct input_thread_s *p_input )
 static int DvdReadSetProgram( input_thread_t * p_input,
                               pgrm_descriptor_t * p_program )
 {
+    if( p_input->stream.p_selected_program != p_program )
+    {
+        thread_dvd_data_t *  p_dvd;
+    
+        p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+        p_dvd->i_angle = p_program->i_number;
+
+        memcpy( p_program, p_input->stream.p_selected_program,
+                sizeof(pgrm_descriptor_t) );
+        p_program->i_number = p_dvd->i_angle;
+        p_input->stream.p_selected_program = p_program;
+
+        intf_WarnMsg( 3, "dvd info: angle %d selected", p_dvd->i_angle );
+    }
+
     return 0;
 }
 
@@ -564,14 +578,11 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
          */
         p_dvd->i_angle_nb = p_vmg->tt_srpt->title[p_area->i_id-1].nr_of_angles;
 
-        if( p_dvd->i_angle > p_area->i_angle_nb )
+        if( p_dvd->i_angle > p_dvd->i_angle_nb )
         {
             p_dvd->i_angle = 1;
         }
 
-        p_area->i_angle = p_dvd->i_angle;
-        p_area->i_angle_nb = p_dvd->i_angle_nb;
-
         /*
          * We've got enough info, time to open the title set data.
          */
@@ -598,21 +609,35 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
             /* We don't use input_EndStream here since
              * we keep area structures */
 
-            for( i = 0 ; i < p_input->stream.i_selected_es_number ; i++ )
+            for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
             {
-                input_UnselectES( p_input, p_input->stream.pp_selected_es[i] );
+                input_DelES( p_input, p_input->stream.pp_es[i] );
             }
 
-            free( p_input->stream.pp_selected_es );
-            input_DelProgram( p_input, p_input->stream.p_selected_program );
+            for( i = 0 ; i < p_input->stream.i_pgrm_number ; i++ )
+            {
+                input_DelProgram( p_input, p_input->stream.pp_programs[i] );
+            }
 
-            p_input->stream.pp_selected_es = NULL;
+            if( p_input->stream.pp_selected_es )
+            {
+                free( p_input->stream.pp_selected_es );
+                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 ) );
+        input_AddProgram( p_input, 1, sizeof( stream_ps_data_t ) );
         p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
 
+        for( i = 1 ; i < p_dvd->i_angle_nb ; i++ )
+        {
+            input_AddProgram( p_input, i+1, 0 );
+        }
+        
+        DvdReadSetProgram( p_input,
+                           p_input->stream.pp_programs[p_dvd->i_angle-1] ); 
+
         /* No PSM to read in DVD mode, we already have all information */
         p_input->stream.p_selected_program->b_is_ok = 1;
 
@@ -621,7 +646,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
         /* ES 0 -> video MPEG2 */
 //        IfoPrintVideo( p_dvd );
 
-        p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xe0, 0 );
+        p_es = input_AddES( p_input, NULL, 0xe0, 0 );
         p_es->i_stream_id = 0xe0;
         p_es->i_type = MPEG2_VIDEO_ES;
         p_es->i_cat = VIDEO_ES;
@@ -647,8 +672,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                 {
                 case 0x00:              /* AC3 */
                     i_id = ( ( 0x80 + i_position ) << 8 ) | 0xbd;
-                    p_es = input_AddES( p_input,
-                               p_input->stream.p_selected_program, i_id, 0 );
+                    p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = 0xbd;
                     p_es->i_type = AC3_AUDIO_ES;
                     p_es->b_audio = 1;
@@ -661,8 +685,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                 case 0x02:
                 case 0x03:              /* MPEG audio */
                     i_id = 0xc0 + i_position;
-                    p_es = input_AddES( p_input,
-                                    p_input->stream.p_selected_program, i_id, 0 );
+                    p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = i_id;
                     p_es->i_type = MPEG2_AUDIO_ES;
                     p_es->b_audio = 1;
@@ -675,8 +698,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                 case 0x04:              /* LPCM */
 
                     i_id = ( ( 0xa0 + i_position ) << 8 ) | 0xbd;
-                    p_es = input_AddES( p_input,
-                                    p_input->stream.p_selected_program, i_id, 0 );
+                    p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = i_id;
                     p_es->i_type = LPCM_AUDIO_ES;
                     p_es->b_audio = 1;
@@ -740,8 +762,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                 }
 
                 i_id = ( ( 0x20 + i_position ) << 8 ) | 0xbd;
-                p_es = input_AddES( p_input,
-                                    p_input->stream.p_selected_program, i_id, 0 );
+                p_es = input_AddES( p_input, NULL, i_id, 0 );
                 p_es->i_stream_id = 0xbd;
                 p_es->i_type = DVD_SPU_ES;
                 p_es->i_cat = SPU_ES;
@@ -797,12 +818,6 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
 #undef p_vts
 #undef p_vmg
 
-    if( p_area->i_angle != p_dvd->i_angle )
-    {
-        p_dvd->i_angle = p_area->i_angle;
-
-        intf_WarnMsg( 3, "dvd info: angle %d selected", p_area->i_angle );
-    }
     /* warn interface that something has changed */
     p_area->i_tell = LB2OFF( p_dvd->i_next_vobu ) - p_area->i_start;
     p_input->stream.b_seekable = 1;
index f89935665f1f87d7a8bfe8f7059fe94023496ade..794caab5cfa4e71577201a995e9dfa3ef1ef4b2b 100644 (file)
              <right_justify>False</right_justify>
            </widget>
 
-           <widget>
-             <class>GtkMenuItem</class>
-             <name>menubar_angle</name>
-             <sensitive>False</sensitive>
-             <tooltip>Choose angle</tooltip>
-             <label>An_gle</label>
-             <right_justify>False</right_justify>
-           </widget>
-
            <widget>
              <class>GtkMenuItem</class>
              <name>separator7</name>
              <last_modification_time>Sat, 19 May 2001 03:13:28 GMT</last_modification_time>
            </signal>
            <stock_button>GNOME_STOCK_BUTTON_PREV</stock_button>
-           <relief>GTK_RELIEF_NORMAL</relief>
+           <relief>GTK_RELIEF_NONE</relief>
            <child>
              <padding>0</padding>
              <expand>False</expand>
              <last_modification_time>Sat, 19 May 2001 03:13:23 GMT</last_modification_time>
            </signal>
            <stock_button>GNOME_STOCK_BUTTON_NEXT</stock_button>
-           <relief>GTK_RELIEF_NORMAL</relief>
+           <relief>GTK_RELIEF_NONE</relief>
            <child>
              <padding>0</padding>
              <expand>False</expand>
              <last_modification_time>Tue, 29 May 2001 13:13:41 GMT</last_modification_time>
            </signal>
            <stock_button>GNOME_STOCK_BUTTON_DOWN</stock_button>
-           <relief>GTK_RELIEF_NORMAL</relief>
+           <relief>GTK_RELIEF_NONE</relief>
            <child>
              <padding>0</padding>
              <expand>False</expand>
              <last_modification_time>Sat, 19 May 2001 03:13:08 GMT</last_modification_time>
            </signal>
            <stock_button>GNOME_STOCK_BUTTON_UP</stock_button>
-           <relief>GTK_RELIEF_NORMAL</relief>
+           <relief>GTK_RELIEF_NONE</relief>
            <child>
              <padding>0</padding>
              <expand>False</expand>
     <signal>
       <name>activate</name>
       <handler>GnomePopupPlayActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:16:58 GMT</last_modification_time>
     </signal>
     <label>Play</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupPauseActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:17:31 GMT</last_modification_time>
     </signal>
     <label>Pause</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupStopActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:18:10 GMT</last_modification_time>
     </signal>
     <label>Stop</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupBackActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:18:21 GMT</last_modification_time>
     </signal>
     <label>Back</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupSlowActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:18:29 GMT</last_modification_time>
     </signal>
     <label>Slow</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupFastActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:18:37 GMT</last_modification_time>
     </signal>
     <label>Fast</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupWindowToggleActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:18:51 GMT</last_modification_time>
     </signal>
     <label>Toggle _Interface</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupFullscreenActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:19:07 GMT</last_modification_time>
     </signal>
     <label>_Fullscreen</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupNextActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:19:18 GMT</last_modification_time>
     </signal>
     <label>Next</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupPrevActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:19:26 GMT</last_modification_time>
     </signal>
     <label>Prev</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupJumpActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:34:46 GMT</last_modification_time>
     </signal>
     <label>_Jump...</label>
   </widget>
 
   <widget>
-    <class>GtkPixmapMenuItem</class>
-    <name>popup_navigation</name>
+    <class>GtkMenuItem</class>
+    <name>popup_program</name>
     <sensitive>False</sensitive>
-    <tooltip>Navigate through titles and chapters</tooltip>
-    <label>_Navigation</label>
+    <tooltip>Switch program</tooltip>
+    <label>Program</label>
     <right_justify>False</right_justify>
-    <stock_icon>GNOME_STOCK_MENU_SEARCH</stock_icon>
   </widget>
 
   <widget>
-    <class>GtkMenuItem</class>
-    <name>popup_angle</name>
+    <class>GtkPixmapMenuItem</class>
+    <name>popup_navigation</name>
     <sensitive>False</sensitive>
-    <label>An_gle</label>
+    <tooltip>Navigate through titles and chapters</tooltip>
+    <label>_Navigation</label>
     <right_justify>False</right_justify>
+    <stock_icon>GNOME_STOCK_MENU_SEARCH</stock_icon>
   </widget>
 
   <widget>
        <signal>
          <name>activate</name>
          <handler>GnomePopupFileOpenActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Sat, 19 May 2001 16:20:08 GMT</last_modification_time>
        </signal>
        <label>_Open File...</label>
        <signal>
          <name>activate</name>
          <handler>GnomePopupDiscOpenActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Sat, 19 May 2001 16:20:44 GMT</last_modification_time>
        </signal>
        <label>Open _Disc...</label>
        <signal>
          <name>activate</name>
          <handler>GnomePopupNetworkOpenActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Sat, 19 May 2001 16:20:54 GMT</last_modification_time>
        </signal>
        <label>_Network Stream...</label>
        <signal>
          <name>activate</name>
          <handler>GnomePopupAboutActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Sat, 19 May 2001 16:21:02 GMT</last_modification_time>
        </signal>
        <stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item>
     <signal>
       <name>activate</name>
       <handler>GnomePopupPlaylistActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:21:14 GMT</last_modification_time>
     </signal>
     <label>Playlist...</label>
     <signal>
       <name>activate</name>
       <handler>GnomePopupPreferencesActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:21:25 GMT</last_modification_time>
     </signal>
     <stock_item>GNOMEUIINFO_MENU_PREFERENCES_ITEM</stock_item>
     <signal>
       <name>activate</name>
       <handler>GnomePopupExitActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Sat, 19 May 2001 16:21:45 GMT</last_modification_time>
     </signal>
     <stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item>
index c8d077841ca6a56bd368ec2c982a656f0de2d05c..74fad977aa69298742377d7869e48757debc799f 100644 (file)
@@ -87,13 +87,6 @@ static GnomeUIInfo menubar_view_menu_uiinfo[] =
     GNOME_APP_PIXMAP_NONE, NULL,
     0, (GdkModifierType) 0, NULL
   },
-  {
-    GNOME_APP_UI_ITEM, N_("An_gle"),
-    N_("Choose angle"),
-    (gpointer) NULL, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
-    0, (GdkModifierType) 0, NULL
-  },
   GNOMEUIINFO_SEPARATOR,
   {
     GNOME_APP_UI_ITEM, N_("_Playlist..."),
@@ -296,30 +289,24 @@ create_intf_window (void)
   gtk_widget_set_sensitive (menubar_view_menu_uiinfo[5].widget, FALSE);
 
   gtk_widget_ref (menubar_view_menu_uiinfo[6].widget);
-  gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_angle",
+  gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7",
                             menubar_view_menu_uiinfo[6].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_set_sensitive (menubar_view_menu_uiinfo[6].widget, FALSE);
 
   gtk_widget_ref (menubar_view_menu_uiinfo[7].widget);
-  gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7",
+  gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
                             menubar_view_menu_uiinfo[7].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
 
   gtk_widget_ref (menubar_view_menu_uiinfo[8].widget);
-  gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
+  gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
                             menubar_view_menu_uiinfo[8].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_set_sensitive (menubar_view_menu_uiinfo[8].widget, FALSE);
 
   gtk_widget_ref (menubar_view_menu_uiinfo[9].widget);
-  gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
-                            menubar_view_menu_uiinfo[9].widget,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_set_sensitive (menubar_view_menu_uiinfo[9].widget, FALSE);
-
-  gtk_widget_ref (menubar_view_menu_uiinfo[10].widget);
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_messages",
-                            menubar_view_menu_uiinfo[10].widget,
+                            menubar_view_menu_uiinfo[9].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
 
   gtk_widget_ref (menubar_uiinfo[2].widget);
@@ -613,6 +600,7 @@ create_intf_window (void)
   gtk_widget_show (button_title_prev);
   gtk_box_pack_start (GTK_BOX (title_chapter_box), button_title_prev, FALSE, FALSE, 0);
   gtk_tooltips_set_tip (tooltips, button_title_prev, _("Select previous title"), NULL);
+  gtk_button_set_relief (GTK_BUTTON (button_title_prev), GTK_RELIEF_NONE);
 
   button_title_next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
   gtk_widget_ref (button_title_next);
@@ -620,6 +608,7 @@ create_intf_window (void)
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (button_title_next);
   gtk_box_pack_start (GTK_BOX (title_chapter_box), button_title_next, FALSE, FALSE, 0);
+  gtk_button_set_relief (GTK_BUTTON (button_title_next), GTK_RELIEF_NONE);
 
   vseparator1 = gtk_vseparator_new ();
   gtk_widget_ref (vseparator1);
@@ -656,6 +645,7 @@ create_intf_window (void)
   gtk_widget_show (button_chapter_prev);
   gtk_box_pack_start (GTK_BOX (dvd_chapter_box), button_chapter_prev, FALSE, FALSE, 0);
   gtk_tooltips_set_tip (tooltips, button_chapter_prev, _("Select previous chapter"), NULL);
+  gtk_button_set_relief (GTK_BUTTON (button_chapter_prev), GTK_RELIEF_NONE);
 
   button_chapter_next = gnome_stock_button (GNOME_STOCK_BUTTON_UP);
   gtk_widget_ref (button_chapter_next);
@@ -664,6 +654,7 @@ create_intf_window (void)
   gtk_widget_show (button_chapter_next);
   gtk_box_pack_start (GTK_BOX (dvd_chapter_box), button_chapter_next, FALSE, FALSE, 0);
   gtk_tooltips_set_tip (tooltips, button_chapter_next, _("Select next chapter"), NULL);
+  gtk_button_set_relief (GTK_BUTTON (button_chapter_next), GTK_RELIEF_NONE);
 
   network_box = gtk_hbox_new (TRUE, 0);
   gtk_widget_ref (network_box);
@@ -902,17 +893,17 @@ static GnomeUIInfo intf_popup_uiinfo[] =
     0, (GdkModifierType) 0, NULL
   },
   {
-    GNOME_APP_UI_ITEM, N_("_Navigation"),
-    N_("Navigate through titles and chapters"),
+    GNOME_APP_UI_ITEM, N_("Program"),
+    N_("Switch program"),
     (gpointer) NULL, NULL, NULL,
-    GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SEARCH,
+    GNOME_APP_PIXMAP_NONE, NULL,
     0, (GdkModifierType) 0, NULL
   },
   {
-    GNOME_APP_UI_ITEM, N_("An_gle"),
-    NULL,
+    GNOME_APP_UI_ITEM, N_("_Navigation"),
+    N_("Navigate through titles and chapters"),
     (gpointer) NULL, NULL, NULL,
-    GNOME_APP_PIXMAP_NONE, NULL,
+    GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SEARCH,
     0, (GdkModifierType) 0, NULL
   },
   {
@@ -1021,13 +1012,13 @@ create_intf_popup (void)
                             (GtkDestroyNotify) gtk_widget_unref);
 
   gtk_widget_ref (intf_popup_uiinfo[13].widget);
-  gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation",
+  gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_program",
                             intf_popup_uiinfo[13].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_set_sensitive (intf_popup_uiinfo[13].widget, FALSE);
 
   gtk_widget_ref (intf_popup_uiinfo[14].widget);
-  gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_angle",
+  gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation",
                             intf_popup_uiinfo[14].widget,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_set_sensitive (intf_popup_uiinfo[14].widget, FALSE);
index 7e6276b0773d08c0aaa14f4ea7b01a74d37a543c..ff2a578de3601fb6503517953325e44e1aac5f5a 100644 (file)
              <right_justify>False</right_justify>
            </widget>
 
-           <widget>
-             <class>GtkMenuItem</class>
-             <name>menubar_angle</name>
-             <sensitive>False</sensitive>
-             <label>An_gle</label>
-             <right_justify>False</right_justify>
-           </widget>
-
            <widget>
              <class>GtkMenuItem</class>
              <name>separator11</name>
     <signal>
       <name>activate</name>
       <handler>GtkPlayActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:53:43 GMT</last_modification_time>
     </signal>
     <label>_Play</label>
     <signal>
       <name>activate</name>
       <handler>GtkPauseActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:53:37 GMT</last_modification_time>
     </signal>
     <label>Pause</label>
     <signal>
       <name>activate</name>
       <handler>GtKStopActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:53:29 GMT</last_modification_time>
     </signal>
     <label>Stop</label>
     <signal>
       <name>activate</name>
       <handler>GtkBackActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:53:21 GMT</last_modification_time>
     </signal>
     <label>Back</label>
     <signal>
       <name>activate</name>
       <handler>GtkSlowActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:53:15 GMT</last_modification_time>
     </signal>
     <label>Slow</label>
     <signal>
       <name>activate</name>
       <handler>GtkFastActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:53:07 GMT</last_modification_time>
     </signal>
     <label>Fast</label>
     <signal>
       <name>activate</name>
       <handler>GtkWindowToggleActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:53:00 GMT</last_modification_time>
     </signal>
     <label>Toggle _Interface</label>
     <signal>
       <name>activate</name>
       <handler>GtkFullscreenActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:52:38 GMT</last_modification_time>
     </signal>
     <label>_Fullscreen</label>
     <signal>
       <name>activate</name>
       <handler>GtkNextActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:52:31 GMT</last_modification_time>
     </signal>
     <label>Next</label>
     <signal>
       <name>activate</name>
       <handler>GtkPrevActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:52:23 GMT</last_modification_time>
     </signal>
     <label>Prev</label>
     <signal>
       <name>activate</name>
       <handler>GtkJumpActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:52:13 GMT</last_modification_time>
     </signal>
     <label>_Jump...</label>
 
   <widget>
     <class>GtkMenuItem</class>
-    <name>popup_navigation</name>
+    <name>popup_program</name>
     <sensitive>False</sensitive>
-    <label>_Navigation</label>
+    <label>Program</label>
     <right_justify>False</right_justify>
   </widget>
 
   <widget>
     <class>GtkMenuItem</class>
-    <name>popup_angle</name>
+    <name>popup_navigation</name>
     <sensitive>False</sensitive>
-    <label>An_gle</label>
+    <label>_Navigation</label>
     <right_justify>False</right_justify>
   </widget>
 
        <signal>
          <name>activate</name>
          <handler>GtkFileOpenActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Mon, 14 May 2001 21:33:55 GMT</last_modification_time>
        </signal>
        <label>_Open File...</label>
        <signal>
          <name>activate</name>
          <handler>GtkDiscOpenActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Mon, 14 May 2001 21:34:09 GMT</last_modification_time>
        </signal>
        <label>Open _Disc...</label>
        <signal>
          <name>activate</name>
          <handler>GtkNetworkOpenActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Mon, 14 May 2001 21:34:23 GMT</last_modification_time>
        </signal>
        <label>_Network Stream...</label>
        <signal>
          <name>activate</name>
          <handler>GtkAboutActivate</handler>
-         <data>&quot;intf_popup&quot;</data>
          <last_modification_time>Mon, 14 May 2001 21:34:54 GMT</last_modification_time>
        </signal>
        <label>_About...</label>
     <signal>
       <name>activate</name>
       <handler>GtkPlaylistActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:51:55 GMT</last_modification_time>
     </signal>
     <label>Playlist...</label>
     <signal>
       <name>activate</name>
       <handler>GtkPreferencesActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:51:46 GMT</last_modification_time>
     </signal>
     <label>_Preferences...</label>
     <signal>
       <name>activate</name>
       <handler>GtkExitActivate</handler>
-      <data>&quot;intf_popup&quot;</data>
       <last_modification_time>Tue, 15 May 2001 13:52:03 GMT</last_modification_time>
     </signal>
     <label>E_xit</label>
index 8dc0af983e4eda17f541ca62514d817f273b0c27..ef4d1bfc1ceb34eea81c7533fb44ca9672c9576c 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_common.h: private Gtk+ interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_common.h,v 1.3 2002/02/24 21:36:20 jobi Exp $
+ * $Id: gtk_common.h,v 1.4 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -57,7 +57,6 @@ typedef struct intf_sys_s
     boolean_t           b_title_update;  /* do we need to update title menus */
     boolean_t           b_chapter_update;            /* do we need to update
                                                                chapter menus */
-    boolean_t           b_angle_update;  /* do we need to update angle menus */
     boolean_t           b_audio_update;  /* do we need to update audio menus */
     boolean_t           b_spu_update;      /* do we need to update spu menus */
 
index 6bc6ea619461fb2d8e5efc10f4551f246a021802..1f9bf793267ec743bc55ad24a7a90134c43666aa 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_display.c: Gtk+ tools for main interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_display.c,v 1.16 2002/03/01 00:33:18 massiot Exp $
+ * $Id: gtk_display.c,v 1.17 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -184,7 +184,6 @@ gint GtkModeManage( intf_thread_t * p_intf )
         p_intf->p_sys->b_program_update = 1;
         p_intf->p_sys->b_title_update = 1;
         p_intf->p_sys->b_chapter_update = 1;
-        p_intf->p_sys->b_angle_update = 1;
         p_intf->p_sys->b_audio_update = 1;
         p_intf->p_sys->b_spu_update = 1;
         p_intf->p_sys->i_part = 0;
index 62aca47b4fa08c8ab08a24e906f80abcf0a89916..8cd01fd669eff202ef0bd7676a6918543b69dbf3 100644 (file)
@@ -41,7 +41,6 @@ create_intf_window (void)
   GtkWidget *menubar_program;
   GtkWidget *menubar_title;
   GtkWidget *menubar_chapter;
-  GtkWidget *menubar_angle;
   GtkWidget *separator11;
   GtkWidget *menubar_playlist;
   GtkWidget *menubar_modules;
@@ -323,18 +322,6 @@ create_intf_window (void)
   gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_chapter);
   gtk_widget_set_sensitive (menubar_chapter, FALSE);
 
-  menubar_angle = gtk_menu_item_new_with_label ("");
-  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_angle)->child),
-                                   _("An_gle"));
-  gtk_widget_add_accelerator (menubar_angle, "activate_item", menubar_view_menu_accels,
-                              tmp_key, 0, 0);
-  gtk_widget_ref (menubar_angle);
-  gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_angle", menubar_angle,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (menubar_angle);
-  gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_angle);
-  gtk_widget_set_sensitive (menubar_angle, FALSE);
-
   separator11 = gtk_menu_item_new ();
   gtk_widget_ref (separator11);
   gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator11", separator11,
@@ -950,8 +937,8 @@ create_intf_popup (void)
   GtkWidget *popup_next;
   GtkWidget *popup_prev;
   GtkWidget *popup_jump;
+  GtkWidget *popup_program;
   GtkWidget *popup_navigation;
-  GtkWidget *popup_angle;
   GtkWidget *popup_audio;
   GtkWidget *popup_subpictures;
   GtkWidget *popup_open;
@@ -1087,6 +1074,14 @@ create_intf_popup (void)
   gtk_widget_show (popup_jump);
   gtk_container_add (GTK_CONTAINER (intf_popup), popup_jump);
 
+  popup_program = gtk_menu_item_new_with_label (_("Program"));
+  gtk_widget_ref (popup_program);
+  gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_program", popup_program,
+                            (GtkDestroyNotify) gtk_widget_unref);
+  gtk_widget_show (popup_program);
+  gtk_container_add (GTK_CONTAINER (intf_popup), popup_program);
+  gtk_widget_set_sensitive (popup_program, FALSE);
+
   popup_navigation = gtk_menu_item_new_with_label ("");
   tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_navigation)->child),
                                    _("_Navigation"));
@@ -1099,18 +1094,6 @@ create_intf_popup (void)
   gtk_container_add (GTK_CONTAINER (intf_popup), popup_navigation);
   gtk_widget_set_sensitive (popup_navigation, FALSE);
 
-  popup_angle = gtk_menu_item_new_with_label ("");
-  tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_angle)->child),
-                                   _("An_gle"));
-  gtk_widget_add_accelerator (popup_angle, "activate_item", intf_popup_accels,
-                              tmp_key, 0, 0);
-  gtk_widget_ref (popup_angle);
-  gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_angle", popup_angle,
-                            (GtkDestroyNotify) gtk_widget_unref);
-  gtk_widget_show (popup_angle);
-  gtk_container_add (GTK_CONTAINER (intf_popup), popup_angle);
-  gtk_widget_set_sensitive (popup_angle, FALSE);
-
   popup_audio = gtk_menu_item_new_with_label ("");
   tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_audio)->child),
                                    _("_Audio"));
@@ -1247,58 +1230,58 @@ create_intf_popup (void)
 
   gtk_signal_connect (GTK_OBJECT (popup_play), "activate",
                       GTK_SIGNAL_FUNC (GtkPlayActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_pause), "activate",
                       GTK_SIGNAL_FUNC (GtkPauseActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_stop), "activate",
                       GTK_SIGNAL_FUNC (GtKStopActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_back), "activate",
                       GTK_SIGNAL_FUNC (GtkBackActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_slow), "activate",
                       GTK_SIGNAL_FUNC (GtkSlowActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_fast), "activate",
                       GTK_SIGNAL_FUNC (GtkFastActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_interface_toggle), "activate",
                       GTK_SIGNAL_FUNC (GtkWindowToggleActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_fullscreen), "activate",
                       GTK_SIGNAL_FUNC (GtkFullscreenActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_next), "activate",
                       GTK_SIGNAL_FUNC (GtkNextActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_prev), "activate",
                       GTK_SIGNAL_FUNC (GtkPrevActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_jump), "activate",
                       GTK_SIGNAL_FUNC (GtkJumpActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_file), "activate",
                       GTK_SIGNAL_FUNC (GtkFileOpenActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_disc), "activate",
                       GTK_SIGNAL_FUNC (GtkDiscOpenActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_network), "activate",
                       GTK_SIGNAL_FUNC (GtkNetworkOpenActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_about), "activate",
                       GTK_SIGNAL_FUNC (GtkAboutActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_playlist), "activate",
                       GTK_SIGNAL_FUNC (GtkPlaylistActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_preferences), "activate",
                       GTK_SIGNAL_FUNC (GtkPreferencesActivate),
-                      "intf_popup");
+                      NULL);
   gtk_signal_connect (GTK_OBJECT (popup_exit), "activate",
                       GTK_SIGNAL_FUNC (GtkExitActivate),
-                      "intf_popup");
+                      NULL);
 
   gtk_object_set_data (GTK_OBJECT (intf_popup), "tooltips", tooltips);
 
index 08b70e4c86eb7442fda7fca025b44d8b41ad7727..2e7d7580c2f078a53cae6e49c20064b034e9d638 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_menu.c : functions to handle menu items.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_menu.c,v 1.20 2002/02/25 04:30:03 sam Exp $
+ * $Id: gtk_menu.c,v 1.21 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -95,7 +95,8 @@ gint GtkSetupMenus( intf_thread_t * p_intf );
                    GTK_OBJECT( p_intf->p_sys->window ), (menu) ) );     \
         p_es = (es_descriptor_t*)user_data;                             \
                                                                         \
-        input_ToggleES( p_input_bank->pp_input[0], p_es, menuitem->active );      \
+        input_ToggleES( p_input_bank->pp_input[0],                      \
+                        p_es, menuitem->active );                       \
                                                                         \
         p_intf->p_sys->b_update = menuitem->active;                     \
                                                                         \
@@ -183,30 +184,35 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
 /*
  * Program
  */
+#define GTKPROGRAMTOGGLE( intf )                                            \
+    intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), intf );         \
+                                                                            \
+    if( menuitem->active && !p_intf->p_sys->b_program_update )              \
+    {                                                                       \
+        u16 i_program_id = (ptrdiff_t)user_data;                            \
+                                                                            \
+        input_ChangeProgram( p_input_bank->pp_input[0], i_program_id );     \
+                                                                            \
+        p_intf->p_sys->b_program_update = 1;                                \
+                                                                            \
+        vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );   \
+        GtkSetupMenus( p_intf );                                            \
+        vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock ); \
+                                                                            \
+        p_intf->p_sys->b_program_update = 0;                                \
+                                                                            \
+        input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );    \
+    }
 
 void GtkMenubarProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
 {
-    intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
-    if( menuitem->active && !p_intf->p_sys->b_program_update )
-    {
-        u16 i_program_id = (ptrdiff_t)user_data;
-        
-        input_ChangeProgram( p_input_bank->pp_input[0], i_program_id );
-        
-        p_intf->p_sys->b_program_update = 1;
-        
-        vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
-        GtkSetupMenus( p_intf );
-        vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
-        
-        p_intf->p_sys->b_title_update = 0;
-
-        input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
-
-    }
+    GTKPROGRAMTOGGLE( "intf_window" );
 }
 
+void GtkPopupProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
+{
+    GTKPROGRAMTOGGLE( "intf_popup" );
+}
 
 /*
  * Title
@@ -277,6 +283,7 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
  * Angle
  */
 
+#if 0
 #define GTKANGLETOGGLE( intf, window, menu, callback )                      \
     intf_thread_t * p_intf;                                                 \
     GtkWidget *     p_menu;                                                 \
@@ -314,7 +321,7 @@ void GtkPopupAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
 }
 
 #undef GTKANGLETOGGLE
-
+#endif
 /****************************************************************************
  * Functions to generate menus
  ****************************************************************************/
@@ -441,9 +448,10 @@ static gint GtkRadioMenu( intf_thread_t * p_intf,
  * Builds the program menu according to what have been found in the PAT 
  * by the input. Usefull for multi-programs streams such as DVB ones.
  *****************************************************************************/
-static gint GtkProgramMenu( gpointer          p_data,
-                                GtkWidget *       p_root,
-                          void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
+static gint GtkProgramMenu( gpointer            p_data,
+                            GtkWidget *         p_root,
+                            pgrm_descriptor_t * p_pgrm,
+                      void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
 {
     intf_thread_t *     p_intf;
     GtkWidget *         p_menu;
@@ -451,7 +459,6 @@ static gint GtkProgramMenu( gpointer          p_data,
     GtkWidget *         p_item_active;
     GSList *            p_group;
     char                psz_name[ GTK_MENU_LABEL_SIZE ];
-    gint                i_item;
     gint                i;
 
     /* cast */
@@ -472,30 +479,19 @@ static gint GtkProgramMenu( gpointer          p_data,
     p_menu = gtk_menu_new();
 
     p_item_active = NULL;
-    i_item = 0;
 
     /* create a set of program buttons and append them to the container */
     for( i = 0 ; i < p_input_bank->pp_input[0]->stream.i_pgrm_number ; i++ )
     {
-        i_item++;
-        snprintf( psz_name, GTK_MENU_LABEL_SIZE, "id %x",
+        snprintf( psz_name, GTK_MENU_LABEL_SIZE, "id %d",
             p_input_bank->pp_input[0]->stream.pp_programs[i]->i_number );
+        psz_name[GTK_MENU_LABEL_SIZE-1] = '\0';
             
-        if( psz_name[0] == '\0' )
-        {
-            snprintf( psz_name, GTK_MENU_LABEL_SIZE,
-                      "Program %d", i_item );
-            psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
-        }
-
         p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
         p_group =
             gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
 
-        if( p_input_bank->pp_input[0]->stream.p_new_program ==
-                p_input_bank->pp_input[0]->stream.pp_programs[i] ||
-                p_input_bank->pp_input[0]->stream.p_selected_program == 
-                p_input_bank->pp_input[0]->stream.pp_programs[i] )
+        if( p_pgrm == p_input_bank->pp_input[0]->stream.pp_programs[i] )
         {
             /* don't lose p_item when we append into menu */
             p_item_active = p_item;
@@ -525,7 +521,7 @@ static gint GtkProgramMenu( gpointer          p_data,
     }
 
     /* be sure that menu is sensitive if more than 1 program */
-    if( i_item > 1 )
+    if( p_input_bank->pp_input[0]->stream.i_pgrm_number > 1 )
     {
         gtk_widget_set_sensitive( p_root, TRUE );
     }
@@ -602,13 +598,18 @@ static gint GtkLanguageMenus( gpointer          p_data,
 
     vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
 
+#define ES p_input_bank->pp_input[0]->stream.pp_es[i]
     /* create a set of language buttons and append them to the container */
     for( i = 0 ; i < p_input_bank->pp_input[0]->stream.i_es_number ; i++ )
     {
-        if( p_input_bank->pp_input[0]->stream.pp_es[i]->i_cat == i_cat )
+        if( ( ES->i_cat == i_cat ) &&
+            ( !ES->p_pgrm ||
+              ES->p_pgrm ==
+                 p_input_bank->pp_input[0]->stream.p_selected_program ) )
         {
             i_item++;
-            strcpy( psz_name, p_input_bank->pp_input[0]->stream.pp_es[i]->psz_desc );
+            strcpy( psz_name,
+                    p_input_bank->pp_input[0]->stream.pp_es[i]->psz_desc );
             if( psz_name[0] == '\0' )
             {
                 snprintf( psz_name, GTK_MENU_LABEL_SIZE,
@@ -805,7 +806,8 @@ static gint GtkTitleMenu( gpointer       p_data,
                 gtk_widget_show( p_item );
 
 #define p_area p_input_bank->pp_input[0]->stream.pp_areas[i_title]
-                if( ( p_area == p_input_bank->pp_input[0]->stream.p_selected_area ) &&
+                if( ( p_area ==
+                        p_input_bank->pp_input[0]->stream.p_selected_area ) &&
                     ( p_area->i_part == i_chapter + 1 ) )
                 {
                     p_item_active = p_item;
@@ -846,12 +848,12 @@ static gint GtkTitleMenu( gpointer       p_data,
                 gtk_widget_set_sensitive( p_navigation, TRUE );
             }
 #else
-        GtkRadioMenu( p_intf, p_title_item, p_chapter_group, "Chapter",
-                        p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb,
-                        i_title * 100,
-                        p_input_bank->pp_input[0]->stream.p_selected_area->i_part +
-                            p_input_bank->pp_input[0]->stream.p_selected_area->i_id *100,
-                        pf_toggle );
+            GtkRadioMenu( p_intf, p_title_item, p_chapter_group, "Chapter",
+                p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb,
+                i_title * 100,
+                p_input_bank->pp_input[0]->stream.p_selected_area->i_part +
+                p_input_bank->pp_input[0]->stream.p_selected_area->i_id *100,
+                pf_toggle );
 
 #endif
         }
@@ -903,6 +905,8 @@ static gint GtkTitleMenu( gpointer       p_data,
 /*****************************************************************************
  * GtkSetupMenus: function that generates title/chapter/audio/subpic
  * menus with help from preceding functions
+ *****************************************************************************
+ * Function called with the lock on stream
  *****************************************************************************/
 gint GtkSetupMenus( intf_thread_t * p_intf )
 {
@@ -912,21 +916,36 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
     GtkWidget *         p_popup_menu;
     gint                i;
 
-    p_intf->p_sys->b_title_update |= p_intf->p_sys->b_program_update;
     p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update;
-    p_intf->p_sys->b_angle_update |= p_intf->p_sys->b_title_update;
-    p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update;
-    p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update;
-
-//    vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
+    p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update |
+                                     p_intf->p_sys->b_program_update;
+    p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update |
+                                   p_intf->p_sys->b_program_update;
 
     if( p_intf->p_sys->b_program_update )
     { 
+        pgrm_descriptor_t * p_pgrm;
+        
+        if( p_input_bank->pp_input[0]->stream.p_new_program )
+        {
+            p_pgrm = p_input_bank->pp_input[0]->stream.p_new_program;
+        }
+        else
+        {
+            p_pgrm = p_input_bank->pp_input[0]->stream.p_selected_program;
+        }
+
         p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( 
                             p_intf->p_sys->p_window ), "menubar_program" ) );
+        GtkProgramMenu( p_intf, p_menubar_menu, p_pgrm,
+                        GtkMenubarProgramToggle );
         
-        GtkProgramMenu( p_intf, p_menubar_menu, GtkMenubarProgramToggle );
-        
+        p_intf->p_sys->b_program_update = 1;
+        p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( 
+                            p_intf->p_sys->p_popup ), "popup_program" ) );
+        GtkProgramMenu( p_intf, p_popup_menu, p_pgrm,
+                        GtkPopupProgramToggle );
+
         p_intf->p_sys->b_program_update = 0;
     }
     
@@ -983,25 +1002,6 @@ gint GtkSetupMenus( intf_thread_t * p_intf )
         p_intf->p_sys->b_chapter_update = 0;
     }
 
-    if( p_intf->p_sys->b_angle_update )
-    {
-        p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( 
-                             p_intf->p_sys->p_window ), "menubar_angle" ) );
-        GtkRadioMenu( p_intf, p_menubar_menu, NULL, "Angle",
-                        p_input_bank->pp_input[0]->stream.p_selected_area->i_angle_nb,
-                        p_input_bank->pp_input[0]->stream.p_selected_area->i_angle,
-                        GtkMenubarAngleToggle );
-
-        p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( 
-                             p_intf->p_sys->p_popup ), "popup_angle" ) );
-        GtkRadioMenu( p_intf, p_popup_menu, NULL, "Angle",
-                        p_input_bank->pp_input[0]->stream.p_selected_area->i_angle_nb,
-                        p_input_bank->pp_input[0]->stream.p_selected_area->i_angle,
-                        GtkPopupAngleToggle );
-
-        p_intf->p_sys->b_angle_update = 0;
-    }
-    
     /* look for selected ES */
     p_audio_es = NULL;
     p_spu_es = NULL;
index a8b84c2ebd586cd8a3e16713a6a36fe37167611b..96af2abba727252e972facfab268abcfe5241feb 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.28 2001/12/30 07:09:56 sam Exp $
+ * $Id: input_clock.c,v 1.29 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -219,6 +219,12 @@ int input_ClockManageControl( input_thread_t * p_input,
 void input_ClockManageRef( input_thread_t * p_input,
                            pgrm_descriptor_t * p_pgrm, mtime_t i_clock )
 {
+    /* take selected program if none specified */
+    if( !p_pgrm )
+    {
+        p_pgrm = p_input->stream.p_selected_program;
+    }
+
     if( ( p_pgrm->i_synchro_state != SYNCHRO_OK ) || ( i_clock == 0 ) )
     {
         /* Feed synchro with a new reference point. */
@@ -303,6 +309,12 @@ void input_ClockManageRef( input_thread_t * p_input,
 mtime_t input_ClockGetTS( input_thread_t * p_input,
                           pgrm_descriptor_t * p_pgrm, mtime_t i_ts )
 {
+    /* take selected program if none specified */
+    if( !p_pgrm )
+    {
+        p_pgrm = p_input->stream.p_selected_program;
+    }
+
     if( p_pgrm->i_synchro_state == SYNCHRO_OK )
     {
         return( ClockToSysdate( p_input, p_pgrm, i_ts + p_pgrm->delta_cr )
index 761a74d86470c59f1ede9007f70eb0b2a13882a1..d4f369d10497d2781d0c53853246ef0bdfad9fd6 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-intf.c: services to the interface
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ext-intf.c,v 1.34 2002/02/24 21:36:20 jobi Exp $
+ * $Id: input_ext-intf.c,v 1.35 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -330,8 +330,7 @@ int input_ChangeArea( input_thread_t * p_input, input_area_t * p_area )
 /****************************************************************************
  * input_ChangeProgram: interface request a program change
  ****************************************************************************/
-int input_ChangeProgram( input_thread_t * p_input, 
-             u16 i_program_number )
+int input_ChangeProgram( input_thread_t * p_input, u16 i_program_number )
 {
     pgrm_descriptor_t *       p_program;
     
index f3585c03bb07535bedb31b177e6ce449348e5fc3..8af6cc7e2a77fc295bbd9b85b337957c061820cd 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.72 2002/03/03 20:42:21 gbazin Exp $
+ * $Id: input_programs.c,v 1.73 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -283,8 +283,6 @@ input_area_t * input_AddArea( input_thread_t * p_input )
     p_input->stream.pp_areas[i_area_index]->i_seek = NO_SEEK;
     p_input->stream.pp_areas[i_area_index]->i_part_nb = 1;
     p_input->stream.pp_areas[i_area_index]->i_part= 0;
-    p_input->stream.pp_areas[i_area_index]->i_angle_nb = 1;
-    p_input->stream.pp_areas[i_area_index]->i_angle = 0;
 
     return p_input->stream.pp_areas[i_area_index];
 }
index 8b594aba4755a46a4548a96f0a70cd4be924e5d4..7bf7351d2f3ce5041cc856857c138e10c57c2947 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.82 2002/03/04 23:56:37 massiot Exp $
+ * $Id: mpeg_system.c,v 1.83 2002/03/05 17:46:33 stef Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -960,7 +960,8 @@ void input_DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
                     i_mux_rate = (U32_AT(p_header + 8) & 0x7FFFFE) >> 1;
                 }
                 /* Call the pace control. */
-                input_ClockManageRef( p_input, p_input->stream.pp_programs[0],
+                input_ClockManageRef( p_input,
+                                      p_input->stream.p_selected_program,
                                       scr_time );
 
                 if( i_mux_rate != p_input->stream.i_mux_rate