Commit e07551ac authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* src/input/es_out.c:

  - renamed es_out_id_t->psz_description to psz_language to better reflect it's use.
  - Reflect both track name and language (if we know them) in the menu's.
parent 48efd637
/***************************************************************************** /*****************************************************************************
* es_out.c: Es Out handler for input. * es_out.c: Es Out handler for input.
***************************************************************************** *****************************************************************************
...@@ -62,7 +63,7 @@ struct es_out_id_t ...@@ -62,7 +63,7 @@ struct es_out_id_t
/* Channel in the track type */ /* Channel in the track type */
int i_channel; int i_channel;
es_format_t fmt; es_format_t fmt;
char *psz_description; char *psz_language;
decoder_t *p_dec; decoder_t *p_dec;
}; };
...@@ -179,8 +180,8 @@ void input_EsOutDelete( es_out_t *out ) ...@@ -179,8 +180,8 @@ void input_EsOutDelete( es_out_t *out )
{ {
input_DecoderDelete( p_sys->es[i]->p_dec ); input_DecoderDelete( p_sys->es[i]->p_dec );
} }
if( p_sys->es[i]->psz_description ) if( p_sys->es[i]->psz_language )
free( p_sys->es[i]->psz_description ); free( p_sys->es[i]->psz_language );
es_format_Clean( &p_sys->es[i]->fmt ); es_format_Clean( &p_sys->es[i]->fmt );
free( p_sys->es[i] ); free( p_sys->es[i] );
...@@ -301,15 +302,31 @@ static void EsOutESVarUpdate( es_out_t *out, es_out_id_t *es, ...@@ -301,15 +302,31 @@ static void EsOutESVarUpdate( es_out_t *out, es_out_id_t *es,
} }
/* Take care of the ES description */ /* Take care of the ES description */
if( es->psz_description && *es->psz_description ) if( es->fmt.psz_description && *es->fmt.psz_description )
{
if( es->psz_language && *es->psz_language )
{
text.psz_string = malloc( strlen( es->fmt.psz_description) + strlen( es->psz_language ) + 10 );
sprintf( text.psz_string, "%s - [%s]", es->fmt.psz_description, es->psz_language );
}
else text.psz_string = strdup( es->fmt.psz_description );
}
else
{ {
text.psz_string = strdup( es->psz_description ); if( es->psz_language && *es->psz_language )
{
char *temp;
text.psz_string = malloc( strlen( _("Track %i") )+ strlen( es->psz_language ) + 30 );
asprintf( &temp, _("Track %i"), val.i_int );
sprintf( text.psz_string, "%s - [%s]", temp, es->psz_language );
free( temp );
} }
else else
{ {
text.psz_string = malloc( strlen( _("Track %i") ) + 20 ); text.psz_string = malloc( strlen( _("Track %i") ) + 20 );
sprintf( text.psz_string, _("Track %i"), val.i_int ); sprintf( text.psz_string, _("Track %i"), val.i_int );
} }
}
val.i_int = es->i_id; val.i_int = es->i_id;
var_Change( p_input, psz_var, VLC_VAR_ADDCHOICE, &val, &text ); var_Change( p_input, psz_var, VLC_VAR_ADDCHOICE, &val, &text );
...@@ -470,7 +487,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -470,7 +487,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
es->i_channel = 0; es->i_channel = 0;
break; break;
} }
es->psz_description = LanguageGetName( fmt->psz_language ); es->psz_language = LanguageGetName( fmt->psz_language ); /* remember so we only need to do it once */
es->p_dec = NULL; es->p_dec = NULL;
if( es->p_pgrm == p_sys->p_pgrm ) if( es->p_pgrm == p_sys->p_pgrm )
...@@ -795,8 +812,8 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es ) ...@@ -795,8 +812,8 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
break; break;
} }
if( es->psz_description ) if( es->psz_language )
free( es->psz_description ); free( es->psz_language );
es_format_Clean( &es->fmt ); es_format_Clean( &es->fmt );
...@@ -1115,7 +1132,7 @@ static void EsOutAddInfo( es_out_t *out, es_out_id_t *es ) ...@@ -1115,7 +1132,7 @@ static void EsOutAddInfo( es_out_t *out, es_out_id_t *es )
"%.4s", (char*)&fmt->i_codec ); "%.4s", (char*)&fmt->i_codec );
input_Control( p_input, INPUT_ADD_INFO, psz_cat, _("Language"), input_Control( p_input, INPUT_ADD_INFO, psz_cat, _("Language"),
"%s", es->psz_description ); "%s", es->psz_language );
/* Add information */ /* Add information */
switch( fmt->i_cat ) switch( fmt->i_cat )
......
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