]> git.sesse.net Git - vlc/commitdiff
. not a very nice hack, but will probably spare us a few user complaints: if
authorSam Hocevar <sam@videolan.org>
Tue, 30 Jan 2001 05:48:23 +0000 (05:48 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 30 Jan 2001 05:48:23 +0000 (05:48 +0000)
  no -a option is specified, the vlc will play the first audio type it finds,
  so there is no need to specify "-a ac3" for a DVD anymore.

include/input_ext-intf.h
src/input/input_dvd.c
src/input/input_ps.c
src/input/mpeg_system.c
src/interface/main.c

index b19c102b7785e67b4f84e402f47470dc5fe55c3e..70d0a101e112a15f3f44bcf7dd922d00499f21f2 100644 (file)
@@ -4,7 +4,7 @@
  * control the pace of reading. 
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.10 2001/01/24 19:05:55 massiot Exp $
+ * $Id: input_ext-intf.h,v 1.11 2001/01/30 05:48:23 sam Exp $
  *
  * Authors:
  *
@@ -28,9 +28,9 @@
  */
 #define INPUT_MAX_PLUGINS   1
 /* FIXME ! */
-#define REQUESTED_MPEG         0
-#define REQUESTED_AC3          1
-#define REQUESTED_LPCM         2
+#define REQUESTED_MPEG         1
+#define REQUESTED_AC3          2
+#define REQUESTED_LPCM         3
 #define REQUESTED_NOAUDIO    255
 
 /*****************************************************************************
index a2d3461bdb494bac6c7b7cff782356042cc052d3..dd312fe7959ccb2b63be16c82ac40720cca7afc5 100644 (file)
@@ -2,7 +2,7 @@
  * input_dvd.c: DVD reading
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.8 2001/01/29 06:28:19 stef Exp $
+ * $Id: input_dvd.c,v 1.9 2001/01/30 05:48:23 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -249,21 +249,27 @@ static void DVDInit( input_thread_t * p_input )
 
                     case MPEG1_AUDIO_ES:
                     case MPEG2_AUDIO_ES:
-                        if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 )
-                                == REQUESTED_MPEG 
-                            && main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
+                        if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
                                 == (p_es->i_id & 0x1F) )
+                        switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
                         {
+                        case 0:
+                            main_PutIntVariable( INPUT_DVD_AUDIO_VAR,
+                                                 REQUESTED_MPEG );
+                        case REQUESTED_MPEG:
                             input_SelectES( p_input, p_es );
                         }
                         break;
 
                     case AC3_AUDIO_ES:
-                        if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 )
-                                == REQUESTED_AC3
-                            && main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
+                        if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
                                 == ((p_es->i_id & 0xF00) >> 8) )
+                        switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
                         {
+                        case 0:
+                            main_PutIntVariable( INPUT_DVD_AUDIO_VAR,
+                                                 REQUESTED_AC3 );
+                        case REQUESTED_AC3:
                             input_SelectES( p_input, p_es );
                         }
                         break;
@@ -398,7 +404,6 @@ static int DVDRead( input_thread_t * p_input,
             while( (i_startcode & 0xFFFFFF00) != 0x100L )
             {
                 i_startcode <<= 8;
-fprintf( stderr, "sprotch\n" );
                 if( (i_nb = SafeRead( p_input, &i_dummy, 1 )) != 0 )
                 {
                     i_startcode |= i_dummy;
index 1f90a1654e357c26d8b28bc5550b7bf95c15c710..fd6bb1a5d90ef476a7c036a8fa413f2d423b486b 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.20 2001/01/10 19:22:11 massiot Exp $
+ * $Id: input_ps.c,v 1.21 2001/01/30 05:48:23 sam Exp $
  *
  * Authors: 
  *
@@ -179,21 +179,27 @@ static void PSInit( input_thread_t * p_input )
 
                     case MPEG1_AUDIO_ES:
                     case MPEG2_AUDIO_ES:
-                        if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 )
-                                == REQUESTED_MPEG 
-                            && main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
+                        if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
                                 == (p_es->i_id & 0x1F) )
+                        switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
                         {
+                        case 0:
+                            main_PutIntVariable( INPUT_DVD_AUDIO_VAR,
+                                                 REQUESTED_MPEG );
+                        case REQUESTED_MPEG:
                             input_SelectES( p_input, p_es );
                         }
                         break;
 
                     case AC3_AUDIO_ES:
-                        if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 )
-                                == REQUESTED_AC3
-                            && main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
+                        if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
                                 == ((p_es->i_id & 0xF00) >> 8) )
+                        switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
                         {
+                        case 0:
+                            main_PutIntVariable( INPUT_DVD_AUDIO_VAR,
+                                                 REQUESTED_AC3 );
+                        case REQUESTED_AC3:
                             input_SelectES( p_input, p_es );
                         }
                         break;
index b0b12150621075c4f196cb5962eaf626fa703ac0..0f58fcede89c6cb088b2e5e74713cee12c4ba67d 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_system.c: TS, PS and PES management
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: mpeg_system.c,v 1.27 2001/01/24 19:05:55 massiot Exp $
+ * $Id: mpeg_system.c,v 1.28 2001/01/30 05:48:23 sam Exp $
  *
  * Authors: 
  *
@@ -834,13 +834,16 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                         p_es->i_type = MPEG2_AUDIO_ES;
                         p_es->b_audio = 1;
 #ifdef AUTO_SPAWN
-                        if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 )
-                                == REQUESTED_MPEG
-                          && main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
+                        if( !p_input->stream.b_seekable )
+                        if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
                                 == (p_es->i_id & 0x1F) )
+                        switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
                         {
-                            if( !p_input->stream.b_seekable )
-                                input_SelectES( p_input, p_es );
+                        case 0:
+                            main_PutIntVariable( INPUT_DVD_CHANNEL_VAR,
+                                                 REQUESTED_MPEG );
+                        case REQUESTED_MPEG:
+                            input_SelectES( p_input, p_es );
                         }
 #endif
                     }
@@ -850,13 +853,16 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                         p_es->i_type = AC3_AUDIO_ES;
                         p_es->b_audio = 1;
 #ifdef AUTO_SPAWN
-                        if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 )
-                                == REQUESTED_AC3
-                         && main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
+                        if( !p_input->stream.b_seekable )
+                        if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
                                 == ((p_es->i_id & 0xF00) >> 8) )
+                        switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
                         {
-                            if( !p_input->stream.b_seekable )
-                                input_SelectES( p_input, p_es );
+                        case 0:
+                            main_PutIntVariable( INPUT_DVD_CHANNEL_VAR,
+                                                 REQUESTED_AC3 );
+                        case REQUESTED_AC3:
+                            input_SelectES( p_input, p_es );
                         }
 #endif
                     }
index 7449f1561dbdbdbcc6542a5cdaf0b68d2dc4b7e1..b248b14026a539ba027bf280d0afb7e641ff1812 100644 (file)
@@ -587,10 +587,10 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 );
             else if ( ! strcmp(optarg, "lpcm") )
                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_LPCM );
-            else if ( ! strcmp(optarg, "off") )
-                main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_NOAUDIO );
-            else
+            else if ( ! strcmp(optarg, "mpeg") )
                 main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_MPEG );
+            else
+                main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_NOAUDIO );
             break;
         case 'c':
             main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) );