Commit 9e28c5d7 authored by Sam Hocevar's avatar Sam Hocevar

. not a very nice hack, but will probably spare us a few user complaints: if

  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.
parent fdad2a24
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* control the pace of reading. * control the pace of reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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: * Authors:
* *
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
*/ */
#define INPUT_MAX_PLUGINS 1 #define INPUT_MAX_PLUGINS 1
/* FIXME ! */ /* FIXME ! */
#define REQUESTED_MPEG 0 #define REQUESTED_MPEG 1
#define REQUESTED_AC3 1 #define REQUESTED_AC3 2
#define REQUESTED_LPCM 2 #define REQUESTED_LPCM 3
#define REQUESTED_NOAUDIO 255 #define REQUESTED_NOAUDIO 255
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_dvd.c: DVD reading * input_dvd.c: DVD reading
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * 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: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -249,21 +249,27 @@ static void DVDInit( input_thread_t * p_input ) ...@@ -249,21 +249,27 @@ static void DVDInit( input_thread_t * p_input )
case MPEG1_AUDIO_ES: case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES: case MPEG2_AUDIO_ES:
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== REQUESTED_MPEG
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== (p_es->i_id & 0x1F) ) == (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 ); input_SelectES( p_input, p_es );
} }
break; break;
case AC3_AUDIO_ES: case AC3_AUDIO_ES:
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== REQUESTED_AC3
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== ((p_es->i_id & 0xF00) >> 8) ) == ((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 ); input_SelectES( p_input, p_es );
} }
break; break;
...@@ -398,7 +404,6 @@ static int DVDRead( input_thread_t * p_input, ...@@ -398,7 +404,6 @@ static int DVDRead( input_thread_t * p_input,
while( (i_startcode & 0xFFFFFF00) != 0x100L ) while( (i_startcode & 0xFFFFFF00) != 0x100L )
{ {
i_startcode <<= 8; i_startcode <<= 8;
fprintf( stderr, "sprotch\n" );
if( (i_nb = SafeRead( p_input, &i_dummy, 1 )) != 0 ) if( (i_nb = SafeRead( p_input, &i_dummy, 1 )) != 0 )
{ {
i_startcode |= i_dummy; i_startcode |= i_dummy;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management * input_ps.c: PS demux and packet management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * 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: * Authors:
* *
...@@ -179,21 +179,27 @@ static void PSInit( input_thread_t * p_input ) ...@@ -179,21 +179,27 @@ static void PSInit( input_thread_t * p_input )
case MPEG1_AUDIO_ES: case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES: case MPEG2_AUDIO_ES:
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== REQUESTED_MPEG
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== (p_es->i_id & 0x1F) ) == (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 ); input_SelectES( p_input, p_es );
} }
break; break;
case AC3_AUDIO_ES: case AC3_AUDIO_ES:
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== REQUESTED_AC3
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== ((p_es->i_id & 0xF00) >> 8) ) == ((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 ); input_SelectES( p_input, p_es );
} }
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management * mpeg_system.c: TS, PS and PES management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * 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: * Authors:
* *
...@@ -834,12 +834,15 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input, ...@@ -834,12 +834,15 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
p_es->i_type = MPEG2_AUDIO_ES; p_es->i_type = MPEG2_AUDIO_ES;
p_es->b_audio = 1; p_es->b_audio = 1;
#ifdef AUTO_SPAWN #ifdef AUTO_SPAWN
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) if( !p_input->stream.b_seekable )
== REQUESTED_MPEG if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== (p_es->i_id & 0x1F) ) == (p_es->i_id & 0x1F) )
switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
{ {
if( !p_input->stream.b_seekable ) case 0:
main_PutIntVariable( INPUT_DVD_CHANNEL_VAR,
REQUESTED_MPEG );
case REQUESTED_MPEG:
input_SelectES( p_input, p_es ); input_SelectES( p_input, p_es );
} }
#endif #endif
...@@ -850,12 +853,15 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input, ...@@ -850,12 +853,15 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
p_es->i_type = AC3_AUDIO_ES; p_es->i_type = AC3_AUDIO_ES;
p_es->b_audio = 1; p_es->b_audio = 1;
#ifdef AUTO_SPAWN #ifdef AUTO_SPAWN
if( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) if( !p_input->stream.b_seekable )
== REQUESTED_AC3 if( main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
&& main_GetIntVariable( INPUT_DVD_CHANNEL_VAR, 0 )
== ((p_es->i_id & 0xF00) >> 8) ) == ((p_es->i_id & 0xF00) >> 8) )
switch( main_GetIntVariable( INPUT_DVD_AUDIO_VAR, 0 ) )
{ {
if( !p_input->stream.b_seekable ) case 0:
main_PutIntVariable( INPUT_DVD_CHANNEL_VAR,
REQUESTED_AC3 );
case REQUESTED_AC3:
input_SelectES( p_input, p_es ); input_SelectES( p_input, p_es );
} }
#endif #endif
......
...@@ -587,10 +587,10 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -587,10 +587,10 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 ); main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_AC3 );
else if ( ! strcmp(optarg, "lpcm") ) else if ( ! strcmp(optarg, "lpcm") )
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_LPCM ); main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_LPCM );
else if ( ! strcmp(optarg, "off") ) else if ( ! strcmp(optarg, "mpeg") )
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_NOAUDIO );
else
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_MPEG ); main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_MPEG );
else
main_PutIntVariable( INPUT_DVD_AUDIO_VAR, REQUESTED_NOAUDIO );
break; break;
case 'c': case 'c':
main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) ); main_PutIntVariable( INPUT_DVD_CHANNEL_VAR, atoi(optarg) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment