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.
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 );
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;
}
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;
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 )
{
}
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 )
{
* 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>
*
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 );
#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")
"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")
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,