static char *LanguageGetName( const char *psz_code );
static char *LanguageGetCode( const char *psz_lang );
-static char **LanguageSplit( const char *psz_langs );
+static char **LanguageSplit( const char *psz_langs, bool b_default_any );
static int LanguageArrayIndex( char **ppsz_langs, char *psz_lang );
static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm );
char *psz_string;
psz_string = var_GetString( p_input, "audio-language" );
- p_sys->ppsz_audio_language = LanguageSplit( psz_string );
+ p_sys->ppsz_audio_language = LanguageSplit( psz_string, true );
if( p_sys->ppsz_audio_language )
{
for( int i = 0; p_sys->ppsz_audio_language[i]; i++ )
free( psz_string );
psz_string = var_GetString( p_input, "sub-language" );
- p_sys->ppsz_sub_language = LanguageSplit( psz_string );
+ p_sys->ppsz_sub_language = LanguageSplit( psz_string, false );
if( p_sys->ppsz_sub_language )
{
for( int i = 0; p_sys->ppsz_sub_language[i]; i++ )
return strdup("??");
}
-static char **LanguageSplit( const char *psz_langs )
+static char **LanguageSplit( const char *psz_langs, bool b_default_any )
{
char *psz_dup;
char *psz_parser;
{
TAB_APPEND( i_psz, ppsz, strdup("any") );
}
+ else if( !strcmp( psz_parser, "none" ) )
+ {
+ TAB_APPEND( i_psz, ppsz, strdup("none") );
+ }
else
{
psz_code = LanguageGetCode( psz_parser );
if( i_psz )
{
+ if( b_default_any && strcmp( ppsz[i_psz - 1], "none" ) )
+ TAB_APPEND( i_psz, ppsz, strdup("any") );
TAB_APPEND( i_psz, ppsz, NULL );
}
{
if( !strcasecmp( ppsz_langs[i], psz_lang ) ||
!strcasecmp( ppsz_langs[i], "any" ) )
- {
return i;
- }
+ if( !strcasecmp( ppsz_langs[i], "none" ) )
+ break;
}
return -1;
#define INPUT_AUDIOTRACK_LANG_TEXT N_("Audio language")
#define INPUT_AUDIOTRACK_LANG_LONGTEXT N_( \
"Language of the audio track you want to use " \
- "(comma separated, two or three letter country code).")
+ "(comma separated, two or three letter country code, you may use 'none' to avoid a fallback to another language).")
#define INPUT_SUBTRACK_LANG_TEXT N_("Subtitle language")
#define INPUT_SUBTRACK_LANG_LONGTEXT N_( \
"Language of the subtitle track you want to use " \
- "(comma separated, two or three letters country code).")
+ "(comma separated, two or three letters country code, you may use 'any' as a fallback).")
/// \todo Document how to find it
#define INPUT_AUDIOTRACK_ID_TEXT N_("Audio track ID")