Commit 8ba6d9a8 authored by Christophe Massiot's avatar Christophe Massiot

* src/input/es_out.c: New --audio-track-id and --sub-track-id options

   to select a precise track by its ID.
 * modules/demux/ts.c: Enable --ts-es-id-pid by default since I see no
   drawback to it.
parent ab75c697
......@@ -127,7 +127,7 @@ vlc_module_begin();
set_subcategory( SUBCAT_INPUT_DEMUX );
add_string( "ts-extra-pmt", NULL, NULL, PMT_TEXT, PMT_LONGTEXT, VLC_TRUE );
add_bool( "ts-es-id-pid", 0, NULL, PID_TEXT, PID_LONGTEXT, VLC_TRUE );
add_bool( "ts-es-id-pid", 1, NULL, PID_TEXT, PID_LONGTEXT, VLC_TRUE );
add_string( "ts-out", NULL, NULL, TSOUT_TEXT, TSOUT_LONGTEXT, VLC_TRUE );
add_integer( "ts-out-mtu", 1500, NULL, MTUOUT_TEXT,
MTUOUT_LONGTEXT, VLC_TRUE );
......
......@@ -103,8 +103,8 @@ struct es_out_sys_t
int i_sub;
/* es to select */
int i_audio_last;
int i_sub_last;
int i_audio_last, i_audio_id;
int i_sub_last, i_sub_id;
char **ppsz_audio_language;
char **ppsz_sub_language;
......@@ -194,6 +194,12 @@ es_out_t *input_EsOutNew( input_thread_t *p_input )
}
if( val.psz_string ) free( val.psz_string );
var_Get( p_input, "audio-track-id", &val );
p_sys->i_audio_id = val.i_int;
var_Get( p_input, "sub-track-id", &val );
p_sys->i_sub_id = val.i_int;
p_sys->p_es_audio = NULL;
p_sys->p_es_video = NULL;
p_sys->p_es_sub = NULL;
......@@ -903,6 +909,14 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, vlc_bool_t b_force )
if( p_sys->i_audio_last >= 0 )
i_wanted = p_sys->i_audio_last;
if( p_sys->i_audio_id >= 0 )
{
if( es->i_id == p_sys->i_audio_id )
i_wanted = es->i_channel;
else
return;
}
}
else if( i_cat == SPU_ES )
{
......@@ -933,6 +947,14 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, vlc_bool_t b_force )
}
if( p_sys->i_sub_last >= 0 )
i_wanted = p_sys->i_sub_last;
if( p_sys->i_sub_id >= 0 )
{
if( es->i_id == p_sys->i_sub_id )
i_wanted = es->i_channel;
else
return;
}
}
else if( i_cat == VIDEO_ES )
{
......
......@@ -2,7 +2,7 @@
* var.c: object variables for input thread
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* $Id: input.c 7955 2004-06-07 22:21:33Z fenrir $
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -395,6 +395,9 @@ void input_ConfigVarInit ( input_thread_t *p_input )
var_Create( p_input, "audio-language", VLC_VAR_STRING|VLC_VAR_DOINHERIT );
var_Create( p_input, "sub-language", VLC_VAR_STRING|VLC_VAR_DOINHERIT );
var_Create( p_input, "audio-track-id", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
var_Create( p_input, "sub-track-id", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
var_Create( p_input, "sub-file", VLC_VAR_FILE | VLC_VAR_DOINHERIT );
var_Create( p_input, "sub-autodetect-file", VLC_VAR_BOOL |
VLC_VAR_DOINHERIT );
......
......@@ -370,7 +370,7 @@ static char *ppsz_clock_descriptions[] =
#define INPUT_AUDIOTRACK_TEXT N_("Audio track")
#define INPUT_AUDIOTRACK_LONGTEXT N_( \
"Give the stream number of the audio track you want to use" \
"Give the stream number of the audio track you want to use " \
"(from 0 to n).")
#define INPUT_SUBTRACK_TEXT N_("Subtitles track")
......@@ -388,6 +388,14 @@ static char *ppsz_clock_descriptions[] =
"Give the language of the subtitle track you want to use " \
"(comma separted, two or tree letter country code).")
#define INPUT_AUDIOTRACK_ID_TEXT N_("Audio track ID")
#define INPUT_AUDIOTRACK_ID_LONGTEXT N_( \
"Give the stream ID of the audio track you want to use.")
#define INPUT_SUBTRACK_ID_TEXT N_("Subtitles track ID")
#define INPUT_SUBTRACK_ID_LONGTEXT N_( \
"Give the stream ID of the subtitle track you want to use.")
#define INPUT_REPEAT_TEXT N_("Input repetitions")
#define INPUT_REPEAT_LONGTEXT N_("Number of time the same input will be " \
"repeated")
......@@ -1132,6 +1140,10 @@ vlc_module_begin();
add_string( "sub-language", "", NULL,
INPUT_SUBTRACK_LANG_TEXT, INPUT_SUBTRACK_LANG_LONGTEXT,
VLC_FALSE );
add_integer( "audio-track-id", -1, NULL, INPUT_AUDIOTRACK_ID_TEXT,
INPUT_AUDIOTRACK_ID_LONGTEXT, VLC_TRUE );
add_integer( "sub-track-id", -1, NULL,
INPUT_SUBTRACK_ID_TEXT, INPUT_SUBTRACK_ID_LONGTEXT, VLC_TRUE );
set_section( N_( "Playback control" ) , NULL);
add_integer( "input-repeat", 0, NULL,
......
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