Commit 63ce4362 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

variables: pass vlc_list_t directly with VLC_VAR_GETCHOICES

parent 7b9b1e30
...@@ -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_value_t *, vlc_value_t * ); VLC_API void var_FreeList( vlc_list_t *, vlc_list_t * );
/***************************************************************************** /*****************************************************************************
......
...@@ -381,17 +381,17 @@ int libvlc_audio_get_track( libvlc_media_player_t *p_mi ) ...@@ -381,17 +381,17 @@ int libvlc_audio_get_track( libvlc_media_player_t *p_mi )
int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track ) int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track )
{ {
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi ); input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi );
vlc_value_t val_list; vlc_list_t val_list;
int i_ret = -1; int i_ret = -1;
if( !p_input_thread ) if( !p_input_thread )
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_value_t *)NULL ); (vlc_list_t *)NULL );
for( int i = 0; i < val_list.p_list->i_count; i++ ) for( int i = 0; i < val_list.i_count; i++ )
{ {
if( i_track == val_list.p_list->p_values[i].i_int ) if( i_track == val_list.p_values[i].i_int )
{ {
if( var_SetInteger( p_input_thread, "audio-es", i_track ) < 0 ) if( var_SetInteger( p_input_thread, "audio-es", i_track ) < 0 )
break; break;
......
...@@ -1788,13 +1788,13 @@ libvlc_track_description_t * ...@@ -1788,13 +1788,13 @@ libvlc_track_description_t *
if( !p_input ) if( !p_input )
return NULL; return NULL;
vlc_value_t val_list, text_list; vlc_list_t val_list, 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;
/* no tracks */ /* no tracks */
if( val_list.p_list->i_count <= 0 ) if( val_list.i_count <= 0 )
goto end; goto end;
p_track_description = malloc( sizeof *p_track_description ); p_track_description = malloc( sizeof *p_track_description );
...@@ -1805,7 +1805,7 @@ libvlc_track_description_t * ...@@ -1805,7 +1805,7 @@ libvlc_track_description_t *
} }
p_actual = p_track_description; p_actual = p_track_description;
p_previous = NULL; p_previous = NULL;
for( int i = 0; i < val_list.p_list->i_count; i++ ) for( int i = 0; i < val_list.i_count; i++ )
{ {
if( !p_actual ) if( !p_actual )
{ {
...@@ -1819,8 +1819,8 @@ libvlc_track_description_t * ...@@ -1819,8 +1819,8 @@ libvlc_track_description_t *
goto end; goto end;
} }
} }
p_actual->i_id = val_list.p_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_list->p_values[i].psz_string ); p_actual->psz_name = strdup( text_list.p_values[i].psz_string );
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;
......
...@@ -353,17 +353,17 @@ libvlc_track_description_t * ...@@ -353,17 +353,17 @@ libvlc_track_description_t *
int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu ) int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu )
{ {
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi ); input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi );
vlc_value_t list; vlc_list_t list;
int i_ret = -1; int i_ret = -1;
if( !p_input_thread ) if( !p_input_thread )
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_value_t *)NULL); (vlc_list_t *)NULL);
for (int i = 0; i < list.p_list->i_count; i++) for (int i = 0; i < list.i_count; i++)
{ {
if( i_spu == list.p_list->p_values[i].i_int ) if( i_spu == list.p_values[i].i_int )
{ {
if( var_SetInteger( p_input_thread, "spu-es", i_spu ) < 0 ) if( var_SetInteger( p_input_thread, "spu-es", i_spu ) < 0 )
break; break;
...@@ -451,13 +451,13 @@ static void teletext_enable( input_thread_t *p_input_thread, bool b_enable ) ...@@ -451,13 +451,13 @@ static void teletext_enable( input_thread_t *p_input_thread, bool b_enable )
{ {
if( b_enable ) if( b_enable )
{ {
vlc_value_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_value_t *)NULL ) ) &list, (vlc_list_t *)NULL ) )
{ {
if( list.p_list->i_count > 0 ) if( list.i_count > 0 )
var_SetInteger( p_input_thread, "spu-es", var_SetInteger( p_input_thread, "spu-es",
list.p_list->p_values[0].i_int ); list.p_values[0].i_int );
var_FreeList( &list, NULL ); var_FreeList( &list, NULL );
} }
...@@ -568,17 +568,17 @@ int libvlc_video_get_track( libvlc_media_player_t *p_mi ) ...@@ -568,17 +568,17 @@ int libvlc_video_get_track( libvlc_media_player_t *p_mi )
int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track ) int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track )
{ {
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi ); input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi );
vlc_value_t val_list; vlc_list_t val_list;
int i_ret = -1; int i_ret = -1;
if( !p_input_thread ) if( !p_input_thread )
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_value_t *)NULL ); (vlc_list_t *)NULL );
for( int i = 0; i < val_list.p_list->i_count; i++ ) for( int i = 0; i < val_list.i_count; i++ )
{ {
if( i_track == val_list.p_list->p_values[i].i_int ) if( i_track == val_list.p_values[i].i_int )
{ {
if( var_SetInteger( p_input_thread, "video-es", i_track ) < 0 ) if( var_SetInteger( p_input_thread, "video-es", i_track ) < 0 )
break; break;
......
...@@ -277,31 +277,31 @@ static void ProcessGesture( intf_thread_t *p_intf ) ...@@ -277,31 +277,31 @@ static void ProcessGesture( intf_thread_t *p_intf )
if( p_input == NULL ) if( p_input == NULL )
break; break;
vlc_value_t list, list2; vlc_list_t list, list2;
var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES, var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
if( list.p_list->i_count > 1 ) if( list.i_count > 1 )
{ {
int i_audio_es = var_GetInteger( p_input, "audio-es" ); int i_audio_es = var_GetInteger( p_input, "audio-es" );
int i; int i;
for( i = 0; i < list.p_list->i_count; i++ ) for( i = 0; i < list.i_count; i++ )
if( i_audio_es == list.p_list->p_values[i].i_int ) if( i_audio_es == list.p_values[i].i_int )
break; break;
/* value of audio-es was not in choices list */ /* value of audio-es was not in choices list */
if( i == list.p_list->i_count ) if( i == list.i_count )
{ {
msg_Warn( p_input, msg_Warn( p_input,
"invalid current audio track, selecting 0" ); "invalid current audio track, selecting 0" );
i = 0; i = 0;
} }
else if( i == list.p_list->i_count - 1 ) else if( i == list.i_count - 1 )
i = 1; i = 1;
else else
i++; i++;
var_SetInteger( p_input, "audio-es", var_SetInteger( p_input, "audio-es",
list.p_list->p_values[i].i_int ); list.p_values[i].i_int );
} }
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
vlc_object_release( p_input ); vlc_object_release( p_input );
...@@ -314,31 +314,31 @@ static void ProcessGesture( intf_thread_t *p_intf ) ...@@ -314,31 +314,31 @@ static void ProcessGesture( intf_thread_t *p_intf )
if( p_input == NULL ) if( p_input == NULL )
break; break;
vlc_value_t list, list2; vlc_list_t list, list2;
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
if( list.p_list->i_count > 1 ) if( list.i_count > 1 )
{ {
int i_audio_es = var_GetInteger( p_input, "spu-es" ); int i_audio_es = var_GetInteger( p_input, "spu-es" );
int i; int i;
for( i = 0; i < list.p_list->i_count; i++ ) for( i = 0; i < list.i_count; i++ )
if( i_audio_es == list.p_list->p_values[i].i_int ) if( i_audio_es == list.p_values[i].i_int )
break; break;
/* value of audio-es was not in choices list */ /* value of audio-es was not in choices list */
if( i == list.p_list->i_count ) if( i == list.i_count )
{ {
msg_Warn( p_input, msg_Warn( p_input,
"invalid current subtitle track, selecting 0" ); "invalid current subtitle track, selecting 0" );
i = 0; i = 0;
} }
else if( i == list.p_list->i_count - 1 ) else if( i == list.i_count - 1 )
i = 1; i = 1;
else else
i++; i++;
var_SetInteger( p_input, "audio-es", var_SetInteger( p_input, "audio-es",
list.p_list->p_values[i].i_int ); list.p_values[i].i_int );
} }
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
vlc_object_release( p_input ); vlc_object_release( p_input );
......
...@@ -627,14 +627,14 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -627,14 +627,14 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
case ACTIONID_SUBSYNC_MARKSUB: case ACTIONID_SUBSYNC_MARKSUB:
if( p_input ) if( p_input )
{ {
vlc_value_t val, list, list2; vlc_value_t val;
int i_count; vlc_list_t list, list2;
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, &list2 ); &list, &list2 );
i_count = list.p_list->i_count;
if( i_count < 1 || val.i_int < 0 ) if( list.i_count < 1 || val.i_int < 0 )
{ {
DisplayMessage( p_vout, _("No active subtitle") ); DisplayMessage( p_vout, _("No active subtitle") );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
...@@ -696,14 +696,14 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -696,14 +696,14 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
int diff = (i_action == ACTIONID_SUBDELAY_UP) ? 50000 : -50000; int diff = (i_action == ACTIONID_SUBDELAY_UP) ? 50000 : -50000;
if( p_input ) if( p_input )
{ {
vlc_value_t val, list, list2; vlc_value_t val;
int i_count; vlc_list_t list, list2;
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, &list2 ); &list, &list2 );
i_count = list.p_list->i_count;
if( i_count < 1 || val.i_int < 0 ) if( list.i_count < 1 || val.i_int < 0 )
{ {
DisplayMessage( p_vout, _("No active subtitle") ); DisplayMessage( p_vout, _("No active subtitle") );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
...@@ -739,35 +739,38 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -739,35 +739,38 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
case ACTIONID_AUDIO_TRACK: case ACTIONID_AUDIO_TRACK:
if( p_input ) if( p_input )
{ {
vlc_value_t val, list, list2; vlc_value_t val;
int i_count, i; vlc_list_t list, 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,
&list, &list2 ); &list, &list2 );
i_count = list.p_list->i_count;
if( i_count > 1 ) if( list.i_count > 1 )
{ {
for( i = 0; i < i_count; i++ ) int i;
for( i = 0; i < list.i_count; i++ )
{ {
if( val.i_int == list.p_list->p_values[i].i_int ) if( val.i_int == list.p_values[i].i_int )
{ {
break; break;
} }
} }
/* value of audio-es was not in choices list */ /* value of audio-es was not in choices list */
if( i == i_count ) if( i == list.i_count )
{ {
msg_Warn( p_input, msg_Warn( p_input,
"invalid current audio track, selecting 0" ); "invalid current audio track, selecting 0" );
i = 0; i = 0;
} }
else if( i == i_count - 1 ) else if( i == list.i_count - 1 )
i = 1; i = 1;
else else
i++; i++;
var_Set( p_input, "audio-es", list.p_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.p_list->p_values[i].psz_string ); list2.p_values[i].psz_string );
} }
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
...@@ -777,54 +780,56 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -777,54 +780,56 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
case ACTIONID_SUBTITLE_REVERSE_TRACK: case ACTIONID_SUBTITLE_REVERSE_TRACK:
if( p_input ) if( p_input )
{ {
vlc_value_t val, list, list2; vlc_value_t val;
int i_count, i; vlc_list_t list, list2;
int i;
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, &list2 ); &list, &list2 );
i_count = list.p_list->i_count;
if( i_count <= 1 ) if( list.i_count <= 1 )
{ {
DisplayMessage( p_vout, _("Subtitle track: %s"), DisplayMessage( p_vout, _("Subtitle track: %s"),
_("N/A") ); _("N/A") );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
break; break;
} }
for( i = 0; i < i_count; i++ ) for( i = 0; i < list.i_count; i++ )
{ {
if( val.i_int == list.p_list->p_values[i].i_int ) if( val.i_int == list.p_values[i].i_int )
{ {
break; break;
} }
} }
/* value of spu-es was not in choices list */ /* value of spu-es was not in choices list */
if( i == i_count ) if( i == list.i_count )
{ {
msg_Warn( p_input, msg_Warn( p_input,
"invalid current subtitle track, selecting 0" ); "invalid current subtitle track, selecting 0" );
i = 0; i = 0;
} }
else if ((i == i_count - 1) && (i_action == ACTIONID_SUBTITLE_TRACK)) else if ((i == list.i_count - 1) && (i_action == ACTIONID_SUBTITLE_TRACK))
i = 0; i = 0;
else if ((i == 0) && (i_action == ACTIONID_SUBTITLE_REVERSE_TRACK)) else if ((i == 0) && (i_action == ACTIONID_SUBTITLE_REVERSE_TRACK))
i = i_count - 1; i = list.i_count - 1;
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_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.p_list->p_values[i].psz_string ); 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_value_t list, list2; vlc_list_t list, list2;
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
int i_count = list.p_list->i_count;
if( i_count <= 1 ) if( list.i_count <= 1 )
{ {
DisplayMessage( p_vout, _("Subtitle track: %s"), DisplayMessage( p_vout, _("Subtitle track: %s"),
_("N/A") ); _("N/A") );
...@@ -852,18 +857,18 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -852,18 +857,18 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
/* if subtitles were disabled with no saved id, use the first track */ /* if subtitles were disabled with no saved id, use the first track */
if( i_cur_id != -1 || i_new_id != -1 ) if( i_cur_id != -1 || i_new_id != -1 )
{ {
for( int i = 0; i < i_count; ++i ) for( int i = 0; i < list.i_count; ++i )
{ {
if( i_new_id == list.p_list->p_values[i].i_int ) if( i_new_id == list.p_values[i].i_int )
{ {
i_new_index = i; i_new_index = i;
break; break;
} }
} }
} }
var_SetInteger( p_input, "spu-es", list.p_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_list->p_values[i_new_index].psz_string ); list2.p_values[i_new_index].psz_string );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
break; break;
...@@ -871,49 +876,50 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -871,49 +876,50 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
case ACTIONID_PROGRAM_SID_PREV: case ACTIONID_PROGRAM_SID_PREV:
if( p_input ) if( p_input )
{ {
vlc_value_t val, list, list2; vlc_value_t val;
int i_count, i; vlc_list_t list, list2;
int i;
var_Get( p_input, "program", &val ); var_Get( p_input, "program", &val );
var_Change( p_input, "program", VLC_VAR_GETCHOICES, var_Change( p_input, "program", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
i_count = list.p_list->i_count;
if( i_count <= 1 ) if( list.i_count <= 1 )
{ {
DisplayMessage( p_vout, _("Program Service ID: %s"), DisplayMessage( p_vout, _("Program Service ID: %s"),
_("N/A") ); _("N/A") );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
break; break;
} }
for( i = 0; i < i_count; i++ ) for( i = 0; i < list.i_count; i++ )
{ {
if( val.i_int == list.p_list->p_values[i].i_int ) if( val.i_int == list.p_values[i].i_int )
{ {
break; break;
} }
} }
/* value of program sid was not in choices list */ /* value of program sid was not in choices list */
if( i == i_count ) if( i == list.i_count )
{ {
msg_Warn( p_input, msg_Warn( p_input,
"invalid current program SID, selecting 0" ); "invalid current program SID, selecting 0" );
i = 0; i = 0;
} }
else if( i_action == ACTIONID_PROGRAM_SID_NEXT ) { else if( i_action == ACTIONID_PROGRAM_SID_NEXT ) {
if( i == i_count - 1 ) if( i == list.i_count - 1 )
i = 0; i = 0;
else else
i++; i++;
} }
else { /* ACTIONID_PROGRAM_SID_PREV */ else { /* ACTIONID_PROGRAM_SID_PREV */
if( i == 0 ) if( i == 0 )
i = i_count - 1; i = list.i_count - 1;
else else
i--; i--;
} }
var_Set( p_input, "program", list.p_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_list->p_values[i].psz_string ); list2.p_values[i].psz_string );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
break; break;
...@@ -1037,26 +1043,28 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1037,26 +1043,28 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
case ACTIONID_ASPECT_RATIO: case ACTIONID_ASPECT_RATIO:
if( p_vout ) if( p_vout )
{ {
vlc_value_t val={0}, val_list, text_list; vlc_value_t val;
vlc_list_t val_list, 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,
&val_list, &text_list ) >= 0 ) &val_list, &text_list ) >= 0 )
{ {
int i; int i;
for( i = 0; i < val_list.p_list->i_count; i++ ) for( i = 0; i < val_list.i_count; i++ )
{ {
if( !strcmp( val_list.p_list->p_values[i].psz_string, if( !strcmp( val_list.p_values[i].psz_string,
val.psz_string ) ) val.psz_string ) )
{ {
i++; i++;
break; break;
} }
} }
if( i == val_list.p_list->i_count ) i = 0; if( i == val_list.i_count ) i = 0;
var_SetString( p_vout, "aspect-ratio", var_SetString( p_vout, "aspect-ratio",
val_list.p_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_list->p_values[i].psz_string ); text_list.p_values[i].psz_string );
var_FreeList( &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
...@@ -1067,26 +1075,28 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input, ...@@ -1067,26 +1075,28 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
case ACTIONID_CROP: case ACTIONID_CROP:
if( p_vout ) if( p_vout )
{ {
vlc_value_t val={0}, val_list, text_list; vlc_value_t val;
vlc_list_t val_list, 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,
&val_list, &text_list ) >= 0 ) &val_list, &text_list ) >= 0 )
{ {
int i; int i;
for( i = 0; i < val_list.p_list->i_count; i++ ) for( i = 0; i < val_list.i_count; i++ )
{ {
if( !strcmp( val_list.p_list->p_values[i].psz_string, if( !strcmp( val_list.p_values[i].psz_string,