]> git.sesse.net Git - vlc/blobdiff - src/input/input_programs.c
* ./src/misc/modules_plugin.h: exported input_ClockManageRef for fenrir.
[vlc] / src / input / input_programs.c
index 06a34b2819eba3ae813ab8aed7063bc0cea1824e..0404a95012a7223ef8efaab6bab1a675ea10b073 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.78 2002/04/08 14:53:05 jobi Exp $
+ * $Id: input_programs.c,v 1.83 2002/04/25 21:52:42 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -35,8 +35,6 @@
 #include "input_ext-dec.h"
 #include "input_ext-plugins.h"
 
-#include "debug.h"
-
 /*
  * NOTICE : all of these functions expect you to have taken the lock on
  * p_input->stream.lock
@@ -306,7 +304,7 @@ int input_SetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_new_prg )
                 i_es_index ++ )
         {
 #define p_es p_input->stream.p_selected_program->pp_es[i_es_index]
-            if ( p_es->p_decoder_fifo )
+            if ( p_es->p_decoder_fifo ) /* if the ES was selected */
             {
                 input_UnselectES( p_input , p_es );
             }
@@ -317,7 +315,7 @@ int input_SetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_new_prg )
     if( p_main->b_audio )
     {
         /* Default is the first one */
-        i_required_audio_es = config_GetIntVariable( "input_channel" );
+        i_required_audio_es = config_GetIntVariable( "audio-channel" );
         if( i_required_audio_es < 0 )
         {
             i_required_audio_es = 1;
@@ -332,7 +330,7 @@ int input_SetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_new_prg )
     if( p_main->b_video )
     {
         /* for spu, default is none */
-        i_required_spu_es = config_GetIntVariable( "input_subtitle" );
+        i_required_spu_es = config_GetIntVariable( "spu-channel" );
         if( i_required_spu_es < 0 )
         {
             i_required_spu_es = 0;
@@ -346,50 +344,36 @@ int input_SetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_new_prg )
     for (i_es_index = 0 ; i_es_index < p_new_prg->i_es_number ; i_es_index ++ )
     {
         switch( p_new_prg->pp_es[i_es_index]->i_cat )
-                    {
-                       case MPEG1_VIDEO_ES:
-                       case MPEG2_VIDEO_ES:
-                           intf_WarnMsg( 4, "Selecting ES %x",
-                                    p_new_prg->pp_es[i_es_index]->i_id );
-                            input_SelectES( p_input,
-                                   p_new_prg->pp_es[i_es_index] );
-                            break;
-                        case MPEG1_AUDIO_ES:
-                        case MPEG2_AUDIO_ES:
-                            i_audio_es += 1;
-                            if( i_audio_es == i_required_audio_es )
-                            {
-                                intf_WarnMsg( 4, "Selecting ES %x",
-                                    p_new_prg->pp_es[i_es_index]->i_id );
-                                input_SelectES( p_input,
-                                    p_new_prg->pp_es[i_es_index]);
-                            }
-                            break;
-                        case LPCM_AUDIO_ES :
-                        case AC3_AUDIO_ES :
-                            i_audio_es += 1;
-                            if( i_audio_es == i_required_audio_es )
-                            {
-                                intf_WarnMsg( 4, "Selecting ES %x",
-                                    p_new_prg->pp_es[i_es_index]->i_id );
-                                input_SelectES( p_input,
-                                    p_new_prg->pp_es[i_es_index] );
-                            }
-                            break;
-                        /* Not sure this one is fully specification-compliant */
-                        case DVD_SPU_ES :
-                            i_spu_es += 1;
-                            if( i_spu_es == i_required_spu_es )
-                            {
-                                intf_WarnMsg( 4, "Selecting ES %x",
-                                    p_new_prg->pp_es[i_es_index]->i_id );
-                                input_SelectES( p_input,
-                                    p_new_prg->pp_es[i_es_index] );
-                            }
-                            break;
-                        default :
-                            break;
-                    }
+        {
+            case VIDEO_ES:
+                intf_WarnMsg( 4, "Selecting ES %x",
+                            p_new_prg->pp_es[i_es_index]->i_id );
+                input_SelectES( p_input, p_new_prg->pp_es[i_es_index] );
+                break;
+            case AUDIO_ES:
+                i_audio_es += 1;
+                if( i_audio_es <= i_required_audio_es )
+                {
+                    intf_WarnMsg( 4, "Selecting ES %x",
+                                p_new_prg->pp_es[i_es_index]->i_id );
+                    input_SelectES( p_input, p_new_prg->pp_es[i_es_index]);
+                }
+                break;
+            /* Not sure this one is fully specification-compliant */
+            case SPU_ES :
+                i_spu_es += 1;
+                if( i_spu_es <= i_required_spu_es )
+                {
+                    intf_WarnMsg( 4, "Selecting ES %x",
+                                p_new_prg->pp_es[i_es_index]->i_id );
+                    input_SelectES( p_input, p_new_prg->pp_es[i_es_index] );
+                }
+            break;
+            default :
+                intf_WarnMsg( 2, "ES %x has unknown type",
+                            p_new_prg->pp_es[i_es_index]->i_id );
+                break;
+        }
 
     }
 
@@ -494,9 +478,7 @@ es_descriptor_t * input_AddES( input_thread_t * p_input,
     p_es->p_decoder_fifo = NULL;
     p_es->b_audio = 0;
     p_es->i_cat = UNKNOWN_ES;
-#ifdef HAVE_SATELLITE
-    p_es->i_dmx_fd = 0;
-#endif
+    p_es->i_demux_fd = 0;
 
     if( i_data_len )
     {
@@ -633,6 +615,8 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
     case AC3_AUDIO_ES:
     case MPEG1_AUDIO_ES:
     case MPEG2_AUDIO_ES:
+    case MPEG4_VIDEO_ES:
+    case MSMPEG4_VIDEO_ES:
     case LPCM_AUDIO_ES:
         if( p_main->b_audio )
         {