]> git.sesse.net Git - vlc/blobdiff - plugins/dvdread/input_dvdread.c
* ./extras/MacOSX_dvdioctl: removed outdated files.
[vlc] / plugins / dvdread / input_dvdread.c
index 13b1331180bcaa619c8ddf63dad043cd5022eb17..883cdce64c5724fd887bd7b8651f2468e370edf0 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.29 2002/03/05 17:46:33 stef Exp $
+ * $Id: input_dvdread.c,v 1.34 2002/03/18 19:14:52 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -131,7 +131,7 @@ void _M( demux_getfunctions )( function_list_t * p_function_list )
  *****************************************************************************/
 static int DvdReadInit( input_thread_t * p_input )
 {
-    if( strncmp( p_input->p_access_module->psz_name, "dvdread", 7 ) )
+    if( p_input->stream.i_method != INPUT_METHOD_DVD )
     {
         return -1;
     }
@@ -289,7 +289,7 @@ static int DvdReadOpen( struct input_thread_s *p_input )
             free( psz_orig );
             return -1;
         }
-        psz_source = config_GetPszVariable( INPUT_DVD_DEVICE_VAR );
+        psz_source = config_GetPszVariable( "dvd_device" );
     }
 
     if( stat( psz_source, &stat_info ) == -1 )
@@ -415,6 +415,8 @@ static int DvdReadOpen( struct input_thread_s *p_input )
 
     vlc_mutex_unlock( &p_input->stream.stream_lock );
 
+    p_input->psz_demux = "dvdread";
+
     return 0;
 }
 
@@ -609,14 +611,14 @@ 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_es_number ; i++ )
+            while( p_input->stream.i_es_number )
             {
-                input_DelES( p_input, p_input->stream.pp_es[i] );
+                input_DelES( p_input, p_input->stream.pp_es[0] );
             }
 
-            for( i = 0 ; i < p_input->stream.i_pgrm_number ; i++ )
+            while( p_input->stream.i_pgrm_number )
             {
-                input_DelProgram( p_input, p_input->stream.pp_programs[i] );
+                input_DelProgram( p_input, p_input->stream.pp_programs[0] );
             }
 
             if( p_input->stream.pp_selected_es )
@@ -1211,17 +1213,15 @@ static void DvdReadLauchDecoders( input_thread_t * p_input )
     if( p_main->b_audio )
     {
         /* For audio: first one if none or a not existing one specified */
-        int i_audio = config_GetIntVariable( INPUT_CHANNEL_VAR );
+        int i_audio = config_GetIntVariable( "input_channel" );
         if( i_audio < 0 /*|| i_audio > i_audio_nb*/ )
         {
-            config_PutIntVariable( INPUT_CHANNEL_VAR, 1 );
+            config_PutIntVariable( "input_channel", 1 );
             i_audio = 1;
         }
         if( i_audio > 0/* && i_audio_nb > 0*/ )
         {
-            if( config_GetIntVariable( AOUT_SPDIF_VAR ) ||
-                ( config_GetIntVariable( INPUT_AUDIO_VAR ) ==
-                  REQUESTED_AC3 ) )
+            if( config_GetIntVariable( "input_audio" ) == REQUESTED_AC3 )
             {
                 int     i_ac3 = i_audio;
                 while( ( p_input->stream.pp_es[i_ac3]->i_type !=
@@ -1247,10 +1247,10 @@ static void DvdReadLauchDecoders( input_thread_t * p_input )
     if( p_main->b_video )
     {
         /* for spu, default is none */
-        int i_spu = config_GetIntVariable( INPUT_SUBTITLE_VAR );
+        int i_spu = config_GetIntVariable( "input_subtitle" );
         if( i_spu < 0 /*|| i_spu > i_spu_nb*/ )
         {
-            config_PutIntVariable( INPUT_SUBTITLE_VAR, 0 );
+            config_PutIntVariable( "input_subtitle", 0 );
             i_spu = 0;
         }
         if( i_spu > 0 /*&& i_spu_nb > 0*/ )