]> git.sesse.net Git - vlc/blobdiff - plugins/mpeg/input_ps.c
* Fixed the BeOS compile typo.
[vlc] / plugins / mpeg / input_ps.c
index d9df981630c183f907915bfffa5ea9bfe5e0ce9f..856856c723f61ca56ab35a7e85f1ffb8ebb383d5 100644 (file)
@@ -2,7 +2,7 @@
  * input_ps.c: PS demux and packet management
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_ps.c,v 1.23 2001/05/08 00:43:57 sam Exp $
+ * $Id: input_ps.c,v 1.25 2001/05/30 17:03:12 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Cyril Deguet <asmax@via.ecp.fr>
@@ -88,8 +88,8 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
 #define input p_function_list->functions.input
     p_function_list->pf_probe = PSProbe;
     input.pf_init             = PSInit;
-    input.pf_open             = input_FileOpen;
-    input.pf_close            = input_FileClose;
+    input.pf_open             = NULL; /* Set in PSInit */
+    input.pf_close            = NULL;
     input.pf_end              = PSEnd;
     input.pf_set_area         = NULL;
     input.pf_read             = PSRead;
@@ -167,6 +167,10 @@ static void PSInit( input_thread_t * p_input )
     }
     p_input->p_method_data = (void *)p_packet_cache;
 
+    /* Set callback */
+    p_input->pf_open  = p_input->pf_file_open;
+    p_input->pf_close = p_input->pf_file_close;
+
     /* Initialize packet cache mutex */
     vlc_mutex_init( &p_packet_cache->lock );
     
@@ -338,7 +342,16 @@ static void PSInit( input_thread_t * p_input )
                         break;
 
                     case LPCM_AUDIO_ES:
-                        /* FIXME ! */
+                        if( main_GetIntVariable( INPUT_CHANNEL_VAR, 0 )
+                                == ((p_es->i_id & 0x1F00) >> 8) )
+                        switch( main_GetIntVariable( INPUT_AUDIO_VAR, 0 ) )
+                        {
+                        case 0:
+                            main_PutIntVariable( INPUT_AUDIO_VAR,
+                                                 REQUESTED_LPCM );
+                        case REQUESTED_LPCM:
+                            input_SelectES( p_input, p_es );
+                        }
                         break;
                 }
             }