Commit 34925c7c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

variables: use char *** for VLC_VAR_GETCHOICES texts

parent 6e94ac80
...@@ -212,7 +212,7 @@ VLC_API int var_Inherit( vlc_object_t *, const char *, int, vlc_value_t * ); ...@@ -212,7 +212,7 @@ VLC_API int var_Inherit( vlc_object_t *, const char *, int, vlc_value_t * );
* @param p_val: the list variable * @param p_val: the list variable
* @param p_val2: the variable associated or NULL * @param p_val2: the variable associated or NULL
*/ */
VLC_API void var_FreeList( vlc_list_t *, vlc_list_t * ); VLC_API void var_FreeList( vlc_list_t *, char *** );
/***************************************************************************** /*****************************************************************************
......
...@@ -388,7 +388,7 @@ int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track ) ...@@ -388,7 +388,7 @@ int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track )
return -1; return -1;
var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list,
(vlc_list_t *)NULL ); (char ***)NULL );
for( int i = 0; i < val_list.i_count; i++ ) for( int i = 0; i < val_list.i_count; i++ )
{ {
if( i_track == val_list.p_values[i].i_int ) if( i_track == val_list.p_values[i].i_int )
......
...@@ -1788,7 +1788,8 @@ libvlc_track_description_t * ...@@ -1788,7 +1788,8 @@ libvlc_track_description_t *
if( !p_input ) if( !p_input )
return NULL; return NULL;
vlc_list_t val_list, text_list; vlc_list_t val_list;
char **text_list;
int i_ret = var_Change( p_input, psz_variable, VLC_VAR_GETCHOICES, &val_list, &text_list ); int i_ret = var_Change( p_input, psz_variable, VLC_VAR_GETCHOICES, &val_list, &text_list );
if( i_ret != VLC_SUCCESS ) if( i_ret != VLC_SUCCESS )
return NULL; return NULL;
...@@ -1820,7 +1821,7 @@ libvlc_track_description_t * ...@@ -1820,7 +1821,7 @@ libvlc_track_description_t *
} }
} }
p_actual->i_id = val_list.p_values[i].i_int; p_actual->i_id = val_list.p_values[i].i_int;
p_actual->psz_name = strdup( text_list.p_values[i].psz_string ); p_actual->psz_name = strdup( text_list[i] );
p_actual->p_next = NULL; p_actual->p_next = NULL;
if( p_previous ) if( p_previous )
p_previous->p_next = p_actual; p_previous->p_next = p_actual;
......
...@@ -360,7 +360,7 @@ int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu ) ...@@ -360,7 +360,7 @@ int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu )
return -1; return -1;
var_Change(p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &list, var_Change(p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &list,
(vlc_list_t *)NULL); (char ***)NULL);
for (int i = 0; i < list.i_count; i++) for (int i = 0; i < list.i_count; i++)
{ {
if( i_spu == list.p_values[i].i_int ) if( i_spu == list.p_values[i].i_int )
...@@ -453,7 +453,7 @@ static void teletext_enable( input_thread_t *p_input_thread, bool b_enable ) ...@@ -453,7 +453,7 @@ static void teletext_enable( input_thread_t *p_input_thread, bool b_enable )
{ {
vlc_list_t list; vlc_list_t list;
if( !var_Change( p_input_thread, "teletext-es", VLC_VAR_GETCHOICES, if( !var_Change( p_input_thread, "teletext-es", VLC_VAR_GETCHOICES,
&list, (vlc_list_t *)NULL ) ) &list, (char ***)NULL ) )
{ {
if( list.i_count > 0 ) if( list.i_count > 0 )
var_SetInteger( p_input_thread, "spu-es", var_SetInteger( p_input_thread, "spu-es",
...@@ -575,7 +575,7 @@ int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track ) ...@@ -575,7 +575,7 @@ int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track )
return -1; return -1;
var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list,
(vlc_list_t *)NULL ); (char ***)NULL );
for( int i = 0; i < val_list.i_count; i++ ) for( int i = 0; i < val_list.i_count; i++ )
{ {
if( i_track == val_list.p_values[i].i_int ) if( i_track == val_list.p_values[i].i_int )
......
...@@ -279,7 +279,7 @@ static void ProcessGesture( intf_thread_t *p_intf ) ...@@ -279,7 +279,7 @@ static void ProcessGesture( intf_thread_t *p_intf )
vlc_list_t list; vlc_list_t list;
var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES, var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES,
&list, (vlc_list_t *)NULL ); &list, (char ***)NULL );
if( list.i_count > 1 ) if( list.i_count > 1 )
{ {
...@@ -316,7 +316,7 @@ static void ProcessGesture( intf_thread_t *p_intf ) ...@@ -316,7 +316,7 @@ static void ProcessGesture( intf_thread_t *p_intf )
vlc_list_t list; vlc_list_t list;
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, (vlc_list_t *)NULL ); &list, (char ***)NULL );
if( list.i_count > 1 ) if( list.i_count > 1 )
{ {
......
...@@ -632,7 +632,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -632,7 +632,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
var_Get( p_input, "spu-es", &val ); var_Get( p_input, "spu-es", &val );
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, (vlc_list_t *)NULL ); &list, (char ***)NULL );
if( list.i_count < 1 || val.i_int < 0 ) if( list.i_count < 1 || val.i_int < 0 )
{ {
...@@ -701,7 +701,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -701,7 +701,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
var_Get( p_input, "spu-es", &val ); var_Get( p_input, "spu-es", &val );
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, (vlc_list_t *)NULL ); &list, (char ***)NULL );
if( list.i_count < 1 || val.i_int < 0 ) if( list.i_count < 1 || val.i_int < 0 )
{ {
...@@ -740,7 +740,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -740,7 +740,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_input ) if( p_input )
{ {
vlc_value_t val; vlc_value_t val;
vlc_list_t list, list2; vlc_list_t list;
char **list2;
var_Get( p_input, "audio-es", &val ); var_Get( p_input, "audio-es", &val );
var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES, var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES,
...@@ -769,8 +770,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -769,8 +770,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
else else
i++; i++;
var_Set( p_input, "audio-es", list.p_values[i] ); var_Set( p_input, "audio-es", list.p_values[i] );
DisplayMessage( p_vout, _("Audio track: %s"), DisplayMessage( p_vout, _("Audio track: %s"), list2[i] );
list2.p_values[i].psz_string );
} }
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
...@@ -781,7 +781,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -781,7 +781,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_input ) if( p_input )
{ {
vlc_value_t val; vlc_value_t val;
vlc_list_t list, list2; vlc_list_t list;
char **list2;
int i; int i;
var_Get( p_input, "spu-es", &val ); var_Get( p_input, "spu-es", &val );
...@@ -816,15 +817,15 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -816,15 +817,15 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
else else
i = (i_action == ACTIONID_SUBTITLE_TRACK) ? i+1 : i-1; i = (i_action == ACTIONID_SUBTITLE_TRACK) ? i+1 : i-1;
var_SetInteger( p_input, "spu-es", list.p_values[i].i_int ); var_SetInteger( p_input, "spu-es", list.p_values[i].i_int );
DisplayMessage( p_vout, _("Subtitle track: %s"), DisplayMessage( p_vout, _("Subtitle track: %s"), list2[i] );
list2.p_values[i].psz_string );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
break; break;
case ACTIONID_SUBTITLE_TOGGLE: case ACTIONID_SUBTITLE_TOGGLE:
if( p_input ) if( p_input )
{ {
vlc_list_t list, list2; vlc_list_t list;
char **list2;
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
...@@ -868,7 +869,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -868,7 +869,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
} }
var_SetInteger( p_input, "spu-es", list.p_values[i_new_index].i_int ); var_SetInteger( p_input, "spu-es", list.p_values[i_new_index].i_int );
DisplayMessage( p_vout, _("Subtitle track: %s"), DisplayMessage( p_vout, _("Subtitle track: %s"),
list2.p_values[i_new_index].psz_string ); list2[i_new_index] );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
break; break;
...@@ -877,7 +878,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -877,7 +878,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_input ) if( p_input )
{ {
vlc_value_t val; vlc_value_t val;
vlc_list_t list, list2; vlc_list_t list;
char **list2;
int i; int i;
var_Get( p_input, "program", &val ); var_Get( p_input, "program", &val );
...@@ -919,7 +921,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -919,7 +921,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
} }
var_Set( p_input, "program", list.p_values[i] ); var_Set( p_input, "program", list.p_values[i] );
DisplayMessage( p_vout, _("Program Service ID: %s"), DisplayMessage( p_vout, _("Program Service ID: %s"),
list2.p_values[i].psz_string ); list2[i] );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
break; break;
...@@ -1044,7 +1046,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1044,7 +1046,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_vout ) if( p_vout )
{ {
vlc_value_t val; vlc_value_t val;
vlc_list_t val_list, text_list; vlc_list_t val_list;
char **text_list;
var_Get( p_vout, "aspect-ratio", &val ); var_Get( p_vout, "aspect-ratio", &val );
if( var_Change( p_vout, "aspect-ratio", VLC_VAR_GETCHOICES, if( var_Change( p_vout, "aspect-ratio", VLC_VAR_GETCHOICES,
...@@ -1064,7 +1067,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1064,7 +1067,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
var_SetString( p_vout, "aspect-ratio", var_SetString( p_vout, "aspect-ratio",
val_list.p_values[i].psz_string ); val_list.p_values[i].psz_string );
DisplayMessage( p_vout, _("Aspect ratio: %s"), DisplayMessage( p_vout, _("Aspect ratio: %s"),
text_list.p_values[i].psz_string ); text_list[i] );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
...@@ -1076,7 +1079,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1076,7 +1079,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_vout ) if( p_vout )
{ {
vlc_value_t val; vlc_value_t val;
vlc_list_t val_list, text_list; vlc_list_t val_list;
char **text_list;
var_Get( p_vout, "crop", &val ); var_Get( p_vout, "crop", &val );
if( var_Change( p_vout, "crop", VLC_VAR_GETCHOICES, if( var_Change( p_vout, "crop", VLC_VAR_GETCHOICES,
...@@ -1095,8 +1099,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1095,8 +1099,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( i == val_list.i_count ) i = 0; if( i == val_list.i_count ) i = 0;
var_SetString( p_vout, "crop", var_SetString( p_vout, "crop",
val_list.p_values[i].psz_string ); val_list.p_values[i].psz_string );
DisplayMessage( p_vout, _("Crop: %s"), DisplayMessage( p_vout, _("Crop: %s"), text_list[i] );
text_list.p_values[i].psz_string );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
...@@ -1226,7 +1229,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1226,7 +1229,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_vout ) if( p_vout )
{ {
vlc_value_t val; vlc_value_t val;
vlc_list_t val_list, text_list; vlc_list_t val_list;
char **text_list;
var_Get( p_vout, "zoom", &val ); var_Get( p_vout, "zoom", &val );
if( var_Change( p_vout, "zoom", VLC_VAR_GETCHOICES, if( var_Change( p_vout, "zoom", VLC_VAR_GETCHOICES,
...@@ -1248,8 +1252,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1248,8 +1252,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( i == -1 ) i = val_list.i_count-1; if( i == -1 ) i = val_list.i_count-1;
var_SetFloat( p_vout, "zoom", var_SetFloat( p_vout, "zoom",
val_list.p_values[i].f_float ); val_list.p_values[i].f_float );
DisplayMessage( p_vout, _("Zoom mode: %s"), DisplayMessage( p_vout, _("Zoom mode: %s"), text_list[i] );
text_list.p_values[i].psz_string );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
...@@ -1270,7 +1273,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1270,7 +1273,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
var_SetInteger( p_vout, "deinterlace", 1 ); var_SetInteger( p_vout, "deinterlace", 1 );
char *psz_mode = var_GetString( p_vout, "deinterlace-mode" ); char *psz_mode = var_GetString( p_vout, "deinterlace-mode" );
vlc_list_t vlist, tlist; vlc_list_t vlist;
char **tlist;
if( psz_mode && !var_Change( p_vout, "deinterlace-mode", VLC_VAR_GETCHOICES, &vlist, &tlist ) ) if( psz_mode && !var_Change( p_vout, "deinterlace-mode", VLC_VAR_GETCHOICES, &vlist, &tlist ) )
{ {
const char *psz_text = NULL; const char *psz_text = NULL;
...@@ -1278,7 +1282,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1278,7 +1282,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
{ {
if( !strcmp( vlist.p_values[i].psz_string, psz_mode ) ) if( !strcmp( vlist.p_values[i].psz_string, psz_mode ) )
{ {
psz_text = tlist.p_values[i].psz_string; psz_text = tlist[i];
break; break;
} }
} }
...@@ -1295,7 +1299,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1295,7 +1299,8 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
if( p_vout ) if( p_vout )
{ {
char *psz_mode = var_GetString( p_vout, "deinterlace-mode" ); char *psz_mode = var_GetString( p_vout, "deinterlace-mode" );
vlc_list_t vlist, tlist; vlc_list_t vlist;
char **tlist;
if( psz_mode && !var_Change( p_vout, "deinterlace-mode", VLC_VAR_GETCHOICES, &vlist, &tlist )) if( psz_mode && !var_Change( p_vout, "deinterlace-mode", VLC_VAR_GETCHOICES, &vlist, &tlist ))
{ {
...@@ -1310,7 +1315,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1310,7 +1315,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
} }
} }
if( i == vlist.i_count ) i = 0; if( i == vlist.i_count ) i = 0;
psz_text = tlist.p_values[i].psz_string; psz_text = tlist[i];
var_SetString( p_vout, "deinterlace-mode", vlist.p_values[i].psz_string ); var_SetString( p_vout, "deinterlace-mode", vlist.p_values[i].psz_string );
int i_deinterlace = var_GetInteger( p_vout, "deinterlace" ); int i_deinterlace = var_GetInteger( p_vout, "deinterlace" );
...@@ -1341,7 +1346,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1341,7 +1346,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
var_Get( p_input, "spu-es", &val ); var_Get( p_input, "spu-es", &val );
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, (vlc_list_t *)NULL ); &list, (char ***)NULL );
if( list.i_count < 1 || val.i_int < 0 ) if( list.i_count < 1 || val.i_int < 0 )
{ {
DisplayMessage( p_vout, DisplayMessage( p_vout,
......
...@@ -1122,7 +1122,8 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1122,7 +1122,8 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
else else
{ {
/* get */ /* get */
vlc_list_t val, text; vlc_list_t val;
char **text;
int i_value = var_GetInteger( p_input, psz_variable ); int i_value = var_GetInteger( p_input, psz_variable );
...@@ -1138,10 +1139,10 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1138,10 +1139,10 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
{ {
if ( i_value == val.p_values[i].i_int ) if ( i_value == val.p_values[i].i_int )
msg_rc( "| %"PRId64" - %s *", val.p_values[i].i_int, msg_rc( "| %"PRId64" - %s *", val.p_values[i].i_int,
text.p_values[i].psz_string ); text[i] );
else else
msg_rc( "| %"PRId64" - %s", val.p_values[i].i_int, msg_rc( "| %"PRId64" - %s", val.p_values[i].i_int,
text.p_values[i].psz_string ); text[i] );
} }
var_FreeList( &val, &text ); var_FreeList( &val, &text );
msg_rc( "+----[ end of %s ]", name ); msg_rc( "+----[ end of %s ]", name );
...@@ -1556,7 +1557,8 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1556,7 +1557,8 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
{ {
/* get */ /* get */
char *name; char *name;
vlc_list_t val, text; vlc_list_t val;
char **text;
float f_value = 0.; float f_value = 0.;
char *psz_value = NULL; char *psz_value = NULL;
...@@ -1590,11 +1592,9 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1590,11 +1592,9 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
for ( int i = 0; i < val.i_count; i++ ) for ( int i = 0; i < val.i_count; i++ )
{ {
if ( f_value == val.p_values[i].f_float ) if ( f_value == val.p_values[i].f_float )
msg_rc( "| %f - %s *", val.p_values[i].f_float, msg_rc( "| %f - %s *", val.p_values[i].f_float, text[i] );
text.p_values[i].psz_string );
else else
msg_rc( "| %f - %s", val.p_values[i].f_float, msg_rc( "| %f - %s", val.p_values[i].f_float, text[i] );
text.p_values[i].psz_string );
} }
} }
else else
...@@ -1603,10 +1603,9 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1603,10 +1603,9 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
{ {
if ( !strcmp( psz_value, val.p_values[i].psz_string ) ) if ( !strcmp( psz_value, val.p_values[i].psz_string ) )
msg_rc( "| %s - %s *", val.p_values[i].psz_string, msg_rc( "| %s - %s *", val.p_values[i].psz_string,
text.p_values[i].psz_string ); text[i] );
else else
msg_rc( "| %s - %s", val.p_values[i].psz_string, msg_rc( "| %s - %s", val.p_values[i].psz_string, text[i] );
text.p_values[i].psz_string );
} }
free( psz_value ); free( psz_value );
} }
...@@ -1675,7 +1674,8 @@ static int AudioChannel( vlc_object_t *obj, char const *cmd, ...@@ -1675,7 +1674,8 @@ static int AudioChannel( vlc_object_t *obj, char const *cmd,
if ( !*cur.psz_string ) if ( !*cur.psz_string )
{ {
/* Retrieve all registered ***. */ /* Retrieve all registered ***. */
vlc_list_t val, text; vlc_list_t val;
char **text;
if ( var_Change( p_aout, "stereo-mode", if ( var_Change( p_aout, "stereo-mode",
VLC_VAR_GETCHOICES, &val, &text ) < 0 ) VLC_VAR_GETCHOICES, &val, &text ) < 0 )
{ {
...@@ -1689,11 +1689,9 @@ static int AudioChannel( vlc_object_t *obj, char const *cmd, ...@@ -1689,11 +1689,9 @@ static int AudioChannel( vlc_object_t *obj, char const *cmd,
for ( int i = 0; i < val.i_count; i++ ) for ( int i = 0; i < val.i_count; i++ )
{ {
if ( i_value == val.p_values[i].i_int ) if ( i_value == val.p_values[i].i_int )
msg_rc( "| %"PRId64" - %s *", val.p_values[i].i_int, msg_rc( "| %"PRId64" - %s *", val.p_values[i].i_int, text[i] );
text.p_values[i].psz_string );
else else
msg_rc( "| %"PRId64" - %s", val.p_values[i].i_int, msg_rc( "| %"PRId64" - %s", val.p_values[i].i_int, text[i] );
text.p_values[i].psz_string );
} }
var_FreeList( &val, &text ); var_FreeList( &val, &text );
msg_rc( "+----[ end of %s ]", cmd ); msg_rc( "+----[ end of %s ]", cmd );
......
...@@ -1448,7 +1448,8 @@ ...@@ -1448,7 +1448,8 @@
selector:(SEL)pf_callback selector:(SEL)pf_callback
{ {
vlc_value_t val; vlc_value_t val;
vlc_list_t val_list, text_list; vlc_list_t val_list;
char **text_list;
int i_type, i; int i_type, i;
/* remove previous items */ /* remove previous items */
...@@ -1514,7 +1515,7 @@ ...@@ -1514,7 +1515,7 @@
switch(i_type & VLC_VAR_TYPE) { switch(i_type & VLC_VAR_TYPE) {
case VLC_VAR_STRING: case VLC_VAR_STRING:
title = _NS(text_list.p_values[i].psz_string ? text_list.p_values[i].psz_string : val_list.p_values[i].psz_string); title = _NS(text_list[i] ? text_list[i] : val_list.p_values[i].psz_string);
lmi = [menu addItemWithTitle: title action: pf_callback keyEquivalent: @""]; lmi = [menu addItemWithTitle: title action: pf_callback keyEquivalent: @""];
data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object
...@@ -1529,8 +1530,8 @@ ...@@ -1529,8 +1530,8 @@
case VLC_VAR_INTEGER: case VLC_VAR_INTEGER:
title = text_list.p_values[i].psz_string ? title = text_list[i] ?
_NS(text_list.p_values[i].psz_string) : [NSString stringWithFormat: @"%"PRId64, val_list.p_values[i].i_int]; _NS(text_list[i]) : [NSString stringWithFormat: @"%"PRId64, val_list.p_values[i].i_int];
lmi = [menu addItemWithTitle: title action: pf_callback keyEquivalent: @""]; lmi = [menu addItemWithTitle: title action: pf_callback keyEquivalent: @""];
data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object data = [[VLCAutoGeneratedMenuContent alloc] initWithVariableName: psz_variable ofObject: p_object
......
...@@ -1540,7 +1540,7 @@ static void CycleESTrack(input_thread_t *input, const char *var) ...@@ -1540,7 +1540,7 @@ static void CycleESTrack(input_thread_t *input, const char *var)
vlc_list_t list; vlc_list_t list;
if (var_Change(input, var, VLC_VAR_GETCHOICES, &list, if (var_Change(input, var, VLC_VAR_GETCHOICES, &list,
(vlc_list_t *)NULL) < 0) (char ***)NULL) < 0)
return; return;
int64_t current = var_GetInteger(input, var); int64_t current = var_GetInteger(input, var);
......
...@@ -268,7 +268,8 @@ void AspectRatioComboBox::updateRatios() ...@@ -268,7 +268,8 @@ void AspectRatioComboBox::updateRatios()
{ {
/* Clear the list before updating */ /* Clear the list before updating */
clear(); clear();
vlc_list_t val_list, text_list; vlc_list_t val_list;
char **text_list;
vout_thread_t* p_vout = THEMIM->getVout(); vout_thread_t* p_vout = THEMIM->getVout();
/* Disable if there is no vout */ /* Disable if there is no vout */
...@@ -281,7 +282,7 @@ void AspectRatioComboBox::updateRatios() ...@@ -281,7 +282,7 @@ void AspectRatioComboBox::updateRatios()
var_Change( p_vout, "aspect-ratio", VLC_VAR_GETCHOICES, &val_list, &text_list ); var_Change( p_vout, "aspect-ratio", VLC_VAR_GETCHOICES, &val_list, &text_list );
for( int i = 0; i < val_list.i_count; i++ ) for( int i = 0; i < val_list.i_count; i++ )
addItem( qfu( text_list.p_values[i].psz_string ), addItem( qfu( text_list[i] ),
QString( val_list.p_values[i].psz_string ) ); QString( val_list.p_values[i].psz_string ) );
setEnabled( true ); setEnabled( true );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
......
...@@ -651,7 +651,8 @@ void ExtV4l2::Refresh( void ) ...@@ -651,7 +651,8 @@ void ExtV4l2::Refresh( void )
} }
if( p_obj ) if( p_obj )
{ {
vlc_list_t val, text; vlc_list_t val;
char **text;
int i_ret = var_Change( p_obj, "controls", VLC_VAR_GETCHOICES, int i_ret = var_Change( p_obj, "controls", VLC_VAR_GETCHOICES,
&val, &text ); &val, &text );
if( i_ret < 0 ) if( i_ret < 0 )
...@@ -670,7 +671,7 @@ void ExtV4l2::Refresh( void ) ...@@ -670,7 +671,7 @@ void ExtV4l2::Refresh( void )
for( int i = 0; i < val.i_count; i++ ) for( int i = 0; i < val.i_count; i++ )
{ {
char *vartext; char *vartext;
const char *psz_var = text.p_values[i].psz_string; const char *psz_var = text[i];
if( var_Change( p_obj, psz_var, VLC_VAR_GETTEXT, &vartext ) ) if( var_Change( p_obj, psz_var, VLC_VAR_GETTEXT, &vartext ) )
continue; continue;
...@@ -694,13 +695,13 @@ void ExtV4l2::Refresh( void ) ...@@ -694,13 +695,13 @@ void ExtV4l2::Refresh( void )
QComboBox *combobox = new QComboBox( box ); QComboBox *combobox = new QComboBox( box );
combobox->setObjectName( qfu( psz_var ) ); combobox->setObjectName( qfu( psz_var ) );
vlc_list_t val2, text2; vlc_list_t val2;
char **text2;
var_Change( p_obj, psz_var, VLC_VAR_GETCHOICES, var_Change( p_obj, psz_var, VLC_VAR_GETCHOICES,
&val2, &text2 ); &val2, &text2 );
for( int j = 0; j < val2.i_count; j++ ) for( int j = 0; j < val2.i_count; j++ )
{ {
combobox->addItem( combobox->addItem( text2[j],
text2.p_values[j].psz_string,
qlonglong( val2.p_values[j].i_int) ); qlonglong( val2.p_values[j].i_int) );
if( i_val == val2.p_values[j].i_int ) if( i_val == val2.p_values[j].i_int )
combobox->setCurrentIndex( j ); combobox->setCurrentIndex( j );
......
...@@ -859,7 +859,8 @@ void InputManager::telexSetTransparency( bool b_transparentTelextext ) ...@@ -859,7 +859,8 @@ void InputManager::telexSetTransparency( bool b_transparentTelextext )
void InputManager::activateTeletext( bool b_enable ) void InputManager::activateTeletext( bool b_enable )
{ {
vlc_list_t list, text; vlc_list_t list;
char **text;
if( hasInput() && !var_Change( p_input, "teletext-es", VLC_VAR_GETCHOICES, &list, &text ) ) if( hasInput() && !var_Change( p_input, "teletext-es", VLC_VAR_GETCHOICES, &list, &text ) )
{ {
...@@ -867,10 +868,10 @@ void InputManager::activateTeletext( bool b_enable ) ...@@ -867,10 +868,10 @@ void InputManager::activateTeletext( bool b_enable )
{ {
/* Prefer the page 100 if it is present */ /* Prefer the page 100 if it is present */
int i; int i;
for( i = 0; i < text.i_count; i++ ) for( i = 0; i < list.i_count; i++ )
{ {
/* The description is the page number as a string */ /* The description is the page number as a string */
const char *psz_page = text.p_values[i].psz_string; const char *psz_page = text[i];
if( psz_page && !strcmp( psz_page, "100" ) ) if( psz_page && !strcmp( psz_page, "100" ) )
break; break;
} }
......
...@@ -1375,7 +1375,8 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var, ...@@ -1375,7 +1375,8 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
vlc_object_t *p_object ) vlc_object_t *p_object )