Commit adf4fbbf authored by Rémi Duraffort's avatar Rémi Duraffort

Create a function to free the memory allocated when calling

var_Change(VLC_VAR_GETCHOICES). The memory was freed by a call to
var_Change(VLC_VAR_FREELIST). That's not a good idea as we were doing a lookup
just to free some memory.
parent 63d3a418
...@@ -109,8 +109,7 @@ ...@@ -109,8 +109,7 @@
#define VLC_VAR_GETCHOICES 0x0024 #define VLC_VAR_GETCHOICES 0x0024
#define VLC_VAR_FREECHOICES 0x0025 #define VLC_VAR_FREECHOICES 0x0025
#define VLC_VAR_GETLIST 0x0026 #define VLC_VAR_GETLIST 0x0026
#define VLC_VAR_FREELIST 0x0027 #define VLC_VAR_CHOICESCOUNT 0x0027
#define VLC_VAR_CHOICESCOUNT 0x0028
#define VLC_VAR_INHERITVALUE 0x0030 #define VLC_VAR_INHERITVALUE 0x0030
...@@ -134,6 +133,8 @@ VLC_EXPORT( int, var_GetChecked, ( vlc_object_t *, const char *, int, vlc_value_ ...@@ -134,6 +133,8 @@ VLC_EXPORT( int, var_GetChecked, ( vlc_object_t *, const char *, int, vlc_value_
#define var_Command(a,b,c,d,e) __var_Command( VLC_OBJECT( a ), b, c, d, e ) #define var_Command(a,b,c,d,e) __var_Command( VLC_OBJECT( a ), b, c, d, e )
VLC_EXPORT( int, __var_Command, ( vlc_object_t *, const char *, const char *, const char *, char ** ) ); VLC_EXPORT( int, __var_Command, ( vlc_object_t *, const char *, const char *, const char *, char ** ) );
VLC_EXPORT( void, var_FreeList, ( vlc_value_t *, vlc_value_t * ) );
/** /**
* __var_Create() with automatic casting. * __var_Create() with automatic casting.
*/ */
......
...@@ -2920,7 +2920,7 @@ static void SetAvailControlsByString( vlc_object_t *p_obj, demux_sys_t *p_sys, ...@@ -2920,7 +2920,7 @@ static void SetAvailControlsByString( vlc_object_t *p_obj, demux_sys_t *p_sys,
psz_parser = ( *psz_delim ) ? ( psz_delim + 1 ) : psz_delim; psz_parser = ( *psz_delim ) ? ( psz_delim + 1 ) : psz_delim;
} }
} }
var_Change( p_obj, "allcontrols", VLC_VAR_FREELIST, &val, &text ); var_FreeList( &val, &text );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -541,7 +541,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -541,7 +541,7 @@ static void Run( intf_thread_t *p_intf )
_("Aspect ratio: %s"), _("Aspect ratio: %s"),
text_list.p_list->p_values[i].psz_string ); text_list.p_list->p_values[i].psz_string );
var_Change( p_vout, "aspect-ratio", VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
free( val.psz_string ); free( val.psz_string );
} }
...@@ -569,7 +569,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -569,7 +569,7 @@ static void Run( intf_thread_t *p_intf )
_("Crop: %s"), _("Crop: %s"),
text_list.p_list->p_values[i].psz_string ); text_list.p_list->p_values[i].psz_string );
var_Change( p_vout, "crop", VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
free( val.psz_string ); free( val.psz_string );
} }
...@@ -636,7 +636,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -636,7 +636,7 @@ static void Run( intf_thread_t *p_intf )
_("Deinterlace mode: %s"), _("Deinterlace mode: %s"),
text_list.p_list->p_values[i].psz_string ); text_list.p_list->p_values[i].psz_string );
var_Change( p_vout, "deinterlace", VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
free( val.psz_string ); free( val.psz_string );
} }
...@@ -668,7 +668,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -668,7 +668,7 @@ static void Run( intf_thread_t *p_intf )
_("Zoom mode: %s"), _("Zoom mode: %s"),
text_list.p_list->p_values[i].var.psz_name ); text_list.p_list->p_values[i].var.psz_name );
var_Change( p_vout, "zoom", VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
} }
else if( i_action == ACTIONID_CROP_TOP && p_vout ) else if( i_action == ACTIONID_CROP_TOP && p_vout )
......
...@@ -450,8 +450,7 @@ mvar_t *mvar_InputVarSetNew( intf_thread_t *p_intf, char *name, ...@@ -450,8 +450,7 @@ mvar_t *mvar_InputVarSetNew( intf_thread_t *p_intf, char *name,
} }
/* clean up everything */ /* clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string ); if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
var_Change( p_sys->p_input, psz_variable, VLC_VAR_FREELIST, &val_list, var_FreeList( &val_list, &text_list );
&text_list );
return s; return s;
} }
......
...@@ -1153,8 +1153,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1153,8 +1153,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
&val_list, NULL ); &val_list, NULL );
msg_rc( "Currently playing chapter %d/%d.", msg_rc( "Currently playing chapter %d/%d.",
val.i_int, val_list.p_list->i_count ); val.i_int, val_list.p_list->i_count );
var_Change( p_this, "chapter", VLC_VAR_FREELIST, var_FreeList( &val_list, NULL );
&val_list, NULL );
} }
} }
else if( !strcmp( psz_cmd, "chapter_n" ) ) else if( !strcmp( psz_cmd, "chapter_n" ) )
...@@ -1186,8 +1185,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1186,8 +1185,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
&val_list, NULL ); &val_list, NULL );
msg_rc( "Currently playing title %d/%d.", msg_rc( "Currently playing title %d/%d.",
val.i_int, val_list.p_list->i_count ); val.i_int, val_list.p_list->i_count );
var_Change( p_this, "title", VLC_VAR_FREELIST, var_FreeList( &val_list, NULL );
&val_list, NULL );
} }
} }
else if( !strcmp( psz_cmd, "title_n" ) ) else if( !strcmp( psz_cmd, "title_n" ) )
...@@ -1262,8 +1260,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1262,8 +1260,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
msg_rc( "| %i - %s", val.p_list->p_values[i].i_int, msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string ); text.p_list->p_values[i].psz_string );
} }
var_Change( p_input, psz_variable, VLC_VAR_FREELIST, var_FreeList( &val, &text );
&val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string ); msg_rc( "+----[ end of %s ]", val_name.psz_string );
free( val_name.psz_string ); free( val_name.psz_string );
...@@ -1792,8 +1789,7 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1792,8 +1789,7 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
} }
free( psz_value ); free( psz_value );
} }
var_Change( p_vout, psz_variable, VLC_VAR_FREELIST, var_FreeList( &val, &text );
&val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string ); msg_rc( "+----[ end of %s ]", val_name.psz_string );
free( val_name.psz_string ); free( val_name.psz_string );
...@@ -1880,8 +1876,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1880,8 +1876,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
msg_rc( "| %i - %s", val.p_list->p_values[i].i_int, msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string ); text.p_list->p_values[i].psz_string );
} }
var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST, var_FreeList( &val, &text );
&val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string ); msg_rc( "+----[ end of %s ]", val_name.psz_string );
free( val_name.psz_string ); free( val_name.psz_string );
......
...@@ -843,7 +843,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -843,7 +843,7 @@ static void Close( vlc_object_t *p_this )
{ {
vlc_value_t val; vlc_value_t val;
val.p_list = p_sys->p_programs_list; val.p_list = p_sys->p_programs_list;
var_Change( p_demux, "programs", VLC_VAR_FREELIST, &val, NULL ); var_FreeList( &val, NULL );
} }
/* If in dump mode, then close the file */ /* If in dump mode, then close the file */
......
...@@ -671,13 +671,11 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -671,13 +671,11 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
&val_list, NULL ); &val_list, NULL );
if( val_list.p_list->i_count > val.i_int ) if( val_list.p_list->i_count > val.i_int )
{ {
var_Change( p_input, "chapter", VLC_VAR_FREELIST, var_FreeList( &val_list, NULL );
&val_list, NULL );
var_SetVoid( p_input, "next-chapter" ); var_SetVoid( p_input, "next-chapter" );
break; break;
} }
var_Change( p_input, "chapter", VLC_VAR_FREELIST, var_FreeList( &val_list, NULL );
&val_list, NULL );
} }
/* Try to go to next title */ /* Try to go to next title */
...@@ -687,13 +685,11 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -687,13 +685,11 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
&val_list, NULL ); &val_list, NULL );
if( val_list.p_list->i_count > val.i_int ) if( val_list.p_list->i_count > val.i_int )
{ {
var_Change( p_input, "title", VLC_VAR_FREELIST, var_FreeList( &val_list, NULL );
&val_list, NULL );
var_SetVoid( p_input, "next-title" ); var_SetVoid( p_input, "next-title" );
break; break;
} }
var_Change( p_input, "title", VLC_VAR_FREELIST, var_FreeList( &val_list, NULL );
&val_list, NULL );
} }
/* Try to go to next file */ /* Try to go to next file */
...@@ -1264,7 +1260,7 @@ void LanguageMenu::AttachedToWindow() ...@@ -1264,7 +1260,7 @@ void LanguageMenu::AttachedToWindow()
} }
AddItem( item ); AddItem( item );
} }
var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
vlc_object_release( p_input ); vlc_object_release( p_input );
...@@ -1327,8 +1323,7 @@ void TitleMenu::AttachedToWindow() ...@@ -1327,8 +1323,7 @@ void TitleMenu::AttachedToWindow()
AddItem( item ); AddItem( item );
} }
var_Change( p_input, "title", VLC_VAR_FREELIST, var_FreeList( &val_list, &text_list );
&val_list, &text_list );
} }
vlc_object_release( p_input ); vlc_object_release( p_input );
BMenu::AttachedToWindow(); BMenu::AttachedToWindow();
...@@ -1391,8 +1386,7 @@ void ChapterMenu::AttachedToWindow() ...@@ -1391,8 +1386,7 @@ void ChapterMenu::AttachedToWindow()
AddItem( item ); AddItem( item );
} }
var_Change( p_input, "chapter", VLC_VAR_FREELIST, var_FreeList( &val_list, &text_list );
&val_list, &text_list );
} }
vlc_object_release( p_input ); vlc_object_release( p_input );
BMenu::AttachedToWindow(); BMenu::AttachedToWindow();
......
...@@ -861,7 +861,7 @@ ...@@ -861,7 +861,7 @@
/* clean up everything */ /* clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string ); if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
} }
- (IBAction)toggleVar:(id)sender - (IBAction)toggleVar:(id)sender
......
...@@ -1559,7 +1559,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh ) ...@@ -1559,7 +1559,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
{ {
mvnprintw( y++, 0, COLS, _(" Title : %d/%d"), val.i_int, val_list.p_list->i_count ); mvnprintw( y++, 0, COLS, _(" Title : %d/%d"), val.i_int, val_list.p_list->i_count );
} }
var_Change( p_input, "title", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
} }
/* Chapter */ /* Chapter */
...@@ -1570,7 +1570,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh ) ...@@ -1570,7 +1570,7 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
{ {
mvnprintw( y++, 0, COLS, _(" Chapter : %d/%d"), val.i_int, val_list.p_list->i_count ); mvnprintw( y++, 0, COLS, _(" Chapter : %d/%d"), val.i_int, val_list.p_list->i_count );
} }
var_Change( p_input, "chapter", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
} }
} }
else else
......
...@@ -692,8 +692,7 @@ void ExtV4l2::Refresh( void ) ...@@ -692,8 +692,7 @@ void ExtV4l2::Refresh( void )
if( i_val == val2.p_list->p_values[j].i_int ) if( i_val == val2.p_list->p_values[j].i_int )
combobox->setCurrentIndex( j ); combobox->setCurrentIndex( j );
} }
var_Change( p_obj, psz_var, VLC_VAR_FREELIST, var_FreeList( &val2, &text2 );
&val2, &text2 );
CONNECT( combobox, currentIndexChanged( int ), this, CONNECT( combobox, currentIndexChanged( int ), this,
ValueChange( int ) ); ValueChange( int ) );
...@@ -758,7 +757,7 @@ void ExtV4l2::Refresh( void ) ...@@ -758,7 +757,7 @@ void ExtV4l2::Refresh( void )
} }
free( name.psz_string ); free( name.psz_string );
} }
var_Change( p_obj, "controls", VLC_VAR_FREELIST, &val, &text ); var_FreeList( &val, &text );
vlc_object_release( p_obj ); vlc_object_release( p_obj );
} }
else else
......
...@@ -692,7 +692,7 @@ void InputManager::sectionMenu() ...@@ -692,7 +692,7 @@ void InputManager::sectionMenu()
if( !strcmp( text.p_list->p_values[i].psz_string, "Title" ) ) if( !strcmp( text.p_list->p_values[i].psz_string, "Title" ) )
root = i; root = i;
} }
var_Change( p_input, "title 0", VLC_VAR_FREELIST, &val, &text ); var_FreeList( &val, &text );
var_SetInteger( p_input, "title 0", root ); var_SetInteger( p_input, "title 0", root );
} }
...@@ -760,7 +760,7 @@ void InputManager::activateTeletext( bool b_enable ) ...@@ -760,7 +760,7 @@ void InputManager::activateTeletext( bool b_enable )
i = 0; i = 0;
var_SetInteger( p_input, "spu-es", b_enable ? list.p_list->p_values[i].i_int : -1 ); var_SetInteger( p_input, "spu-es", b_enable ? list.p_list->p_values[i].i_int : -1 );
} }
var_Change( p_input, "teletext-es", VLC_VAR_FREELIST, &list, &text ); var_FreeList( &list, &text );
} }
} }
......
...@@ -1129,7 +1129,7 @@ static bool IsMenuEmpty( const char *psz_var, ...@@ -1129,7 +1129,7 @@ static bool IsMenuEmpty( const char *psz_var,
} }
/* clean up everything */ /* clean up everything */
var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
return i_result; return i_result;
} }
...@@ -1344,7 +1344,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var, ...@@ -1344,7 +1344,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
currentGroup = NULL; currentGroup = NULL;
/* clean up everything */ /* clean up everything */
var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
#undef CURVAL #undef CURVAL
#undef CURTEXT #undef CURTEXT
......
...@@ -688,7 +688,7 @@ HMENU CreateChoicesMenu( intf_thread_t *p_intf, ...@@ -688,7 +688,7 @@ HMENU CreateChoicesMenu( intf_thread_t *p_intf,
/* Clean up everything */ /* Clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string ); if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list ); var_FreeList( &val_list, &text_list );
return hSubMenu; return hSubMenu;
} }
......
...@@ -200,7 +200,7 @@ static int vlclua_var_get_list( lua_State *L ) ...@@ -200,7 +200,7 @@ static int vlclua_var_get_list( lua_State *L )
if( i_ret < 0 ) return vlclua_push_ret( L, i_ret ); if( i_ret < 0 ) return vlclua_push_ret( L, i_ret );
vlclua_pushvalue( L, VLC_VAR_LIST, val ); vlclua_pushvalue( L, VLC_VAR_LIST, val );
vlclua_pushvalue( L, VLC_VAR_LIST, text ); vlclua_pushvalue( L, VLC_VAR_LIST, text );
var_Change( *pp_obj, psz_var, VLC_VAR_FREELIST, &val, &text ); var_FreeList( &val, &text );
return 2; return 2;
} }
......
...@@ -123,7 +123,7 @@ static int Foo( vlc_object_t *p_this, char const *psz_cmd, ...@@ -123,7 +123,7 @@ static int Foo( vlc_object_t *p_this, char const *psz_cmd,
{ {
printf( "value %i: %s\n", i, val.p_list->p_values[i].psz_string ); printf( "value %i: %s\n", i, val.p_list->p_values[i].psz_string );
} }
var_Change( p_this, "honk", VLC_VAR_FREELIST, &val, NULL ); var_FreeList( &val, NULL );
var_Destroy( p_this, "honk" ); var_Destroy( p_this, "honk" );
......
...@@ -380,7 +380,7 @@ int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi, ...@@ -380,7 +380,7 @@ int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi,
var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL ); var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL );
i_track_count = val_list.p_list->i_count; i_track_count = val_list.p_list->i_count;
var_Change( p_input_thread, "audio-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return i_track_count; return i_track_count;
...@@ -429,7 +429,7 @@ int libvlc_audio_get_track( libvlc_media_player_t *p_mi, ...@@ -429,7 +429,7 @@ int libvlc_audio_get_track( libvlc_media_player_t *p_mi,
break; break;
} }
} }
var_Change( p_input_thread, "audio-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return i_track; return i_track;
} }
...@@ -461,7 +461,7 @@ void libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track, ...@@ -461,7 +461,7 @@ void libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track,
libvlc_exception_raise( p_e, "Setting audio track failed" ); libvlc_exception_raise( p_e, "Setting audio track failed" );
end: end:
var_Change( p_input_thread, "audio-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
} }
......
...@@ -1177,7 +1177,7 @@ libvlc_track_description_t * ...@@ -1177,7 +1177,7 @@ libvlc_track_description_t *
if( val_list.p_list->i_count <= 0 ) /* no tracks */ if( val_list.p_list->i_count <= 0 ) /* no tracks */
{ {
var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list); var_FreeList( &val_list, &text_list);
return NULL; return NULL;
} }
...@@ -1186,8 +1186,7 @@ libvlc_track_description_t * ...@@ -1186,8 +1186,7 @@ libvlc_track_description_t *
malloc( sizeof( libvlc_track_description_t ) ); malloc( sizeof( libvlc_track_description_t ) );
if ( !p_track_description ) if ( !p_track_description )
{ {
var_Change( p_input, psz_variable, VLC_VAR_FREELIST, var_FreeList( &val_list, &text_list);
&val_list, &text_list);
vlc_object_release( p_input ); vlc_object_release( p_input );
libvlc_exception_raise( p_e, "no enough memory" ); libvlc_exception_raise( p_e, "no enough memory" );
return NULL; return NULL;
...@@ -1203,8 +1202,7 @@ libvlc_track_description_t * ...@@ -1203,8 +1202,7 @@ libvlc_track_description_t *
if ( !p_actual ) if ( !p_actual )
{ {
libvlc_track_description_release( p_track_description ); libvlc_track_description_release( p_track_description );
var_Change( p_input, psz_variable, VLC_VAR_FREELIST, var_FreeList( &val_list, &text_list);
&val_list, &text_list);
vlc_object_release( p_input ); vlc_object_release( p_input );
libvlc_exception_raise( p_e, "no enough memory" ); libvlc_exception_raise( p_e, "no enough memory" );
return NULL; return NULL;
...@@ -1218,7 +1216,7 @@ libvlc_track_description_t * ...@@ -1218,7 +1216,7 @@ libvlc_track_description_t *
p_previous = p_actual; p_previous = p_actual;
p_actual = NULL; p_actual = NULL;
} }
var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list); var_FreeList( &val_list, &text_list);
vlc_object_release( p_input ); vlc_object_release( p_input );
return p_track_description; return p_track_description;
......
...@@ -272,7 +272,7 @@ int libvlc_video_get_spu( libvlc_media_player_t *p_mi, ...@@ -272,7 +272,7 @@ int libvlc_video_get_spu( libvlc_media_player_t *p_mi,
break; break;
} }
} }
var_Change( p_input_thread, "spu-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return i_spu; return i_spu;
} }
...@@ -289,7 +289,7 @@ int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi, ...@@ -289,7 +289,7 @@ int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi,
var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL ); var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
i_spu_count = val_list.p_list->i_count; i_spu_count = val_list.p_list->i_count;
var_Change( p_input_thread, "spu-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return i_spu_count; return i_spu_count;
...@@ -334,7 +334,7 @@ void libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu, ...@@ -334,7 +334,7 @@ void libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu,
} }
end: end:
var_Change( p_input_thread, "spu-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
} }
...@@ -496,7 +496,7 @@ void libvlc_toggle_teletext( libvlc_media_player_t *p_mi, ...@@ -496,7 +496,7 @@ void libvlc_toggle_teletext( libvlc_media_player_t *p_mi,
if( list.p_list->i_count > 0 ) if( list.p_list->i_count > 0 )
var_SetInteger( p_input_thread, "spu-es", list.p_list->p_values[0].i_int ); var_SetInteger( p_input_thread, "spu-es", list.p_list->p_values[0].i_int );
var_Change( p_input_thread, "teletext-es", VLC_VAR_FREELIST, &list, NULL ); var_FreeList( &list, NULL );
} }
} }
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
...@@ -514,7 +514,7 @@ int libvlc_video_get_track_count( libvlc_media_player_t *p_mi, ...@@ -514,7 +514,7 @@ int libvlc_video_get_track_count( libvlc_media_player_t *p_mi,
var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, NULL ); var_Change( p_input_thread, "video-es", VLC_VAR_GETCHOICES, &val_list, NULL );
i_track_count = val_list.p_list->i_count; i_track_count = val_list.p_list->i_count;
var_Change( p_input_thread, "video-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return i_track_count; return i_track_count;
...@@ -557,7 +557,7 @@ int libvlc_video_get_track( libvlc_media_player_t *p_mi, ...@@ -557,7 +557,7 @@ int libvlc_video_get_track( libvlc_media_player_t *p_mi,
break; break;
} }
} }
var_Change( p_input_thread, "video-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return i_track; return i_track;
} }
...@@ -588,6 +588,6 @@ void libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track, ...@@ -588,6 +588,6 @@ void libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track,
libvlc_exception_raise( p_e, "Video track out of range" ); libvlc_exception_raise( p_e, "Video track out of range" );
end: end:
var_Change( p_input_thread, "video-es", VLC_VAR_FREELIST, &val_list, NULL ); var_FreeList( &val_list, NULL );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
} }
...@@ -1689,7 +1689,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force ) ...@@ -1689,7 +1689,7 @@ static void EsOutSelect( es_out_t *out, es_out_id_t *es, bool b_force )
break; break;
} }
} }
var_Change( p_sys->p_input, "programs", VLC_VAR_FREELIST, &val, NULL ); var_FreeList( &val, NULL );
} }
else if( p_sys->i_mode == ES_OUT_MODE_AUTO ) else if( p_sys->i_mode == ES_OUT_MODE_AUTO )
{ {
......
...@@ -1123,7 +1123,7 @@ static void InitPrograms( input_thread_t * p_input ) ...@@ -1123,7 +1123,7 @@ static void InitPrograms( input_thread_t * p_input )
} }
else else
{ {
var_Change( p_input, "programs", VLC_VAR_FREELIST, &val, NULL ); var_FreeList( &val, NULL );
} }
} }
} }
...@@ -1138,7 +1138,7 @@ static void InitPrograms( input_thread_t * p_input ) ...@@ -1138,7 +1138,7 @@ static void InitPrograms( input_thread_t * p_input )
{ {
demux_Control( p_input->p->input.p_demux, DEMUX_SET_GROUP, -1, demux_Control( p_input->p->input.p_demux, DEMUX_SET_GROUP, -1,
val.p_list ); val.p_list );
var_Change( p_input, "programs", VLC_VAR_FREELIST, &val, NULL ); var_FreeList( &val, NULL );
} }
else else
{ {
...@@ -3228,7 +3228,7 @@ static void SubtitleAdd( input_thread_t *p_input, char *psz_subtitle, bool b_for ...@@ -3228,7 +3228,7 @@ static void SubtitleAdd( input_thread_t *p_input, char *psz_subtitle, bool b_for
es_out_Control( p_input->p->p_es_out_display, ES_OUT_SET_ES_DEFAULT_BY_ID, i_id ); es_out_Control( p_input->p->p_es_out_display, ES_OUT_SET_ES_DEFAULT_BY_ID, i_id );
es_out_Control( p_input->p->p_es_out_display, ES_OUT_SET_ES_BY_ID, i_id ); es_out_Control( p_input->p->p_es_out_display, ES_OUT_SET_ES_BY_ID, i_id );
} }
var_Change( p_input, "spu-es", VLC_VAR_FREELIST, &list, NULL ); var_FreeList( &list, NULL );
} }
} }
......
...@@ -416,6 +416,7 @@ __var_Command ...@@ -416,6 +416,7 @@ __var_Command
__var_Create __var_Create
__var_DelCallback __var_DelCallback
__var_Destroy __var_Destroy
var_FreeList
__var_Get __var_Get
var_GetChecked var_GetChecked
__var_Set __var_Set
......
...@@ -605,20 +605,6 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name, ...@@ -605,20 +605,6 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name,
} }
} }
break; break;
case VLC_VAR_FREELIST:
FreeList( p_val );