]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/menus.cpp
Renamed "deinterlace" into "deinterlace-mode" at the core level.
[vlc] / modules / gui / wince / menus.cpp
index 0c9f50f61449a29f6503810ed7aa0f8d63f6db3a..ff22cb2ecea29f50d6ad99026c6f41699b59b07f 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>                                            /* strerror() */
-#include <stdio.h>
-#include <vlc/vlc.h>
-#include <vlc/intf.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_interface.h>
+#include <vlc_playlist.h>
 
 #include "wince.h"
 
@@ -81,11 +83,11 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
 
     vlc_object_t *p_object, *p_input;
     char *ppsz_varnames[MAX_POPUP_ITEMS];
-    int pi_objects[MAX_POPUP_ITEMS];
+    vlc_object_t * pi_objects[MAX_POPUP_ITEMS];
     int i = 0, i_last_separator = 0;
 
     /* Initializations */
-    memset( pi_objects, 0, MAX_POPUP_ITEMS * sizeof(int) );
+    memset( pi_objects, 0, MAX_POPUP_ITEMS * sizeof(vlc_object_t *) );
 
     ppsz_varnames[i] = "VLC media player";
     pi_objects[i++] = 0;
@@ -98,24 +100,24 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
     if( p_object != NULL )
     {
         ppsz_varnames[i] = "bookmark";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "title";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "chapter";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "program";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "navigation";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "dvd_menus";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
 
         ppsz_varnames[i] = "video-es";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "audio-es";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "spu-es";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
     }
     p_input = p_object;
     if( !p_input ) goto interfacemenu;
@@ -131,21 +133,21 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
         vlc_object_t *p_dec_obj;
 
         ppsz_varnames[i] = "fullscreen";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "zoom";
-        pi_objects[i++] = p_object->i_object_id;
-        ppsz_varnames[i] = "deinterlace";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
+        ppsz_varnames[i] = "deinterlace-mode";
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "aspect-ratio";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "crop";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "video-on-top";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "directx-wallpaper";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "video-snapshot";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
 
         p_dec_obj = (vlc_object_t *)vlc_object_find( p_object,
                                                      VLC_OBJECT_DECODER,
@@ -153,7 +155,7 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
         if( p_dec_obj != NULL )
         {
             ppsz_varnames[i] = "ffmpeg-pp-q";
-            pi_objects[i++] = p_dec_obj->i_object_id;
+            pi_objects[i++] = p_dec_obj;
             vlc_object_release( p_dec_obj );
         }
 
@@ -169,13 +171,13 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
     if( p_object != NULL )
     {
         ppsz_varnames[i] = "audio-device";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "audio-channels";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "visual";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "equalizer";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         vlc_object_release( p_object );
     }
 
@@ -184,14 +186,6 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
     if( i != i_last_separator ) ppsz_varnames[i++] = NULL; /* Separator */
     i_last_separator = i;
 
-    /* vlc_object_find is needed because of the dialogs provider case */
-    p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INTF,
-                                                FIND_PARENT );
-    if( p_object != NULL )
-    {
-        /* Nothing for now */
-        vlc_object_release( p_object );
-    }
 
     /* Build menu */
     vector<MenuItemExt*> popup_menu;
@@ -220,15 +214,13 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
     }
     else
     {
-        playlist_t * p_playlist =
-            (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                           FIND_ANYWHERE );
-        if( p_playlist && p_playlist->i_size )
+        playlist_t * p_playlist = pl_Hold( p_intf );
+        if( p_playlist && !playlist_IsEmpty( p_playlist ) )
         {
             AppendMenu( hmenu, MF_SEPARATOR, 0, _T("") );
             AppendMenu( hmenu, MF_STRING, PlayStream_Event, _T("Play") );
         }
-        if( p_playlist ) vlc_object_release( p_playlist );
+        if( p_playlist ) pl_Release( p_intf );
     }
 
     AppendMenu( hmenu, MF_POPUP|MF_STRING, (UINT)MiscMenu( p_intf ),
@@ -247,7 +239,7 @@ void RefreshAudioMenu( intf_thread_t *p_intf, HMENU hMenu )
 
     vlc_object_t *p_object;
     char *ppsz_varnames[MAX_AUDIO_ITEMS];
-    int pi_objects[MAX_AUDIO_ITEMS];
+    vlc_object_t * pi_objects[MAX_AUDIO_ITEMS];
     int i;
 
     /* Delete old menu */
@@ -260,7 +252,7 @@ void RefreshAudioMenu( intf_thread_t *p_intf, HMENU hMenu )
 
 
     /* Initializations */
-    memset( pi_objects, 0, MAX_AUDIO_ITEMS * sizeof(int) );
+    memset( pi_objects, 0, MAX_AUDIO_ITEMS * sizeof(vlc_object_t *) );
     i = 0;
 
     p_object = (vlc_object_t *)
@@ -268,7 +260,7 @@ void RefreshAudioMenu( intf_thread_t *p_intf, HMENU hMenu )
     if( p_object != NULL )
     {
         ppsz_varnames[i] = "audio-es";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         vlc_object_release( p_object );
     }
 
@@ -277,11 +269,11 @@ void RefreshAudioMenu( intf_thread_t *p_intf, HMENU hMenu )
     if( p_object != NULL )
     {
         ppsz_varnames[i] = "audio-device";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "audio-channels";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "visual";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         vlc_object_release( p_object );
     }
 
@@ -296,7 +288,7 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
 
     vlc_object_t *p_object;
     char *ppsz_varnames[MAX_VIDEO_ITEMS];
-    int pi_objects[MAX_VIDEO_ITEMS];
+    vlc_object_t * pi_objects[MAX_VIDEO_ITEMS];
     int i;
 
     /* Delete old menu */
@@ -308,7 +300,7 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
     else p_intf->p_sys->p_video_menu = new vector<MenuItemExt*>;
 
     /* Initializations */
-    memset( pi_objects, 0, MAX_VIDEO_ITEMS * sizeof(int) );
+    memset( pi_objects, 0, MAX_VIDEO_ITEMS * sizeof(vlc_object_t *) );
     i = 0;
 
     p_object = (vlc_object_t *)
@@ -316,9 +308,9 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
     if( p_object != NULL )
     {
         ppsz_varnames[i] = "video-es";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "spu-es";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         vlc_object_release( p_object );
     }
 
@@ -329,28 +321,28 @@ void RefreshVideoMenu( intf_thread_t *p_intf, HMENU hMenu )
         vlc_object_t *p_dec_obj;
 
         ppsz_varnames[i] = "fullscreen";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
 #ifdef WINCE
         ppsz_varnames[i] = "transform";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
 #endif
         ppsz_varnames[i] = "zoom";
-        pi_objects[i++] = p_object->i_object_id;
-        ppsz_varnames[i] = "deinterlace";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
+        ppsz_varnames[i] = "deinterlace-mode";
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "aspect-ratio";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "crop";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "directx-on-top";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
 
         p_dec_obj = (vlc_object_t *)
             vlc_object_find( p_object, VLC_OBJECT_DECODER, FIND_PARENT );
         if( p_dec_obj != NULL )
         {
             ppsz_varnames[i] = "ffmpeg-pp-q";
-            pi_objects[i++] = p_dec_obj->i_object_id;
+            pi_objects[i++] = p_dec_obj;
             vlc_object_release( p_dec_obj );
         }
 
@@ -368,19 +360,19 @@ void RefreshNavigMenu( intf_thread_t *p_intf, HMENU hMenu )
 
     vlc_object_t *p_object;
     char *ppsz_varnames[MAX_NAVIG_ITEMS];
-    int pi_objects[MAX_NAVIG_ITEMS];
+    vlc_object_t * pi_objects[MAX_NAVIG_ITEMS];
     int i;
 
     /* Delete old menu */
     int count = wce_GetMenuItemCount( hMenu );
     for( i = 0; i <= count; i++ ) RemoveMenu( hMenu, 0, MF_BYPOSITION );
-        
     if( p_intf->p_sys->p_navig_menu )
         MenuItemExt::ClearList( p_intf->p_sys->p_navig_menu );
     else p_intf->p_sys->p_navig_menu = new vector<MenuItemExt*>;
 
     /* Initializations */
-    memset( pi_objects, 0, MAX_NAVIG_ITEMS * sizeof(int) );
+    memset( pi_objects, 0, MAX_NAVIG_ITEMS * sizeof(vlc_object_t *) );
     i = 0;
 
     p_object = (vlc_object_t *)
@@ -388,24 +380,24 @@ void RefreshNavigMenu( intf_thread_t *p_intf, HMENU hMenu )
     if( p_object != NULL )
     {
         ppsz_varnames[i] = "title";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "chapter";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "program";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "navigation";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "dvd_menus";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
 
         ppsz_varnames[i] = "prev-title";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "next-title";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "prev-chapter";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         ppsz_varnames[i] = "next-chapter";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
 
         vlc_object_release( p_object );
     }
@@ -421,7 +413,7 @@ void RefreshSettingsMenu( intf_thread_t *p_intf, HMENU hMenu )
 
     vlc_object_t *p_object;
     char *ppsz_varnames[MAX_SETTINGS_ITEMS];
-    int pi_objects[MAX_SETTINGS_ITEMS];
+    vlc_object_t * pi_objects[MAX_SETTINGS_ITEMS];
     int i;
 
     /* Delete old menu */
@@ -433,21 +425,22 @@ void RefreshSettingsMenu( intf_thread_t *p_intf, HMENU hMenu )
     else p_intf->p_sys->p_settings_menu = new vector<MenuItemExt*>;
 
     /* Initializations */
-    memset( pi_objects, 0, MAX_SETTINGS_ITEMS * sizeof(int) );
+    memset( pi_objects, 0, MAX_SETTINGS_ITEMS * sizeof(vlc_object_t *) );
     i = 0;
 
     AppendMenu( hMenu, MF_STRING, ID_PREFERENCES, _T("&Preferences...") );
 
-    p_object = (vlc_object_t *)
-        vlc_object_find( p_intf, VLC_OBJECT_INTF, FIND_PARENT );
+       /* Other interfaces */
+    /*FIXME: copy the Qt way of mapping menus and objects */
+    /*p_object = (vlc_object_t *) NULL;
+        //vlc_object_find_name( p_intf, "wince", FIND_PARENT );
     if( p_object != NULL )
     {
-        ppsz_varnames[i] = "intf-switch";
-        pi_objects[i++] = p_object->i_object_id;
         ppsz_varnames[i] = "intf-add";
-        pi_objects[i++] = p_object->i_object_id;
+        pi_objects[i++] = p_object;
         vlc_object_release( p_object );
-    }
+    }*/
+
 
     /* Build menu */
     RefreshMenu( p_intf, p_intf->p_sys->p_settings_menu, hMenu, i,
@@ -458,11 +451,11 @@ void RefreshSettingsMenu( intf_thread_t *p_intf, HMENU hMenu )
  * Refresh the menu.
  *****************************************************************************/
 void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
-                  HMENU hMenu , int i_count, char **ppsz_varnames, 
-                  int *pi_objects, int i_start_id )
+                  HMENU hMenu , int i_count, char **ppsz_varnames,
+                  vlc_object_t **pi_objects, int i_start_id )
 {
     vlc_object_t *p_object;
-    vlc_bool_t b_section_empty = VLC_FALSE;
+    bool b_section_empty = false;
     int i;
 
     /* Initializations */
@@ -479,7 +472,7 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
             }
 
             AppendMenu( hMenu, MF_SEPARATOR, 0, _T("") );
-            b_section_empty = VLC_TRUE;
+            b_section_empty = true;
             continue;
         }
 
@@ -488,14 +481,14 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
             AppendMenu( hMenu, MF_GRAYED | MF_STRING,
                         MenuDummy_Event, _FROMMB(ppsz_varnames[i]) );
 
-            b_section_empty = VLC_FALSE;
+            b_section_empty = false;
             continue;
         }
 
-        p_object = (vlc_object_t *)vlc_object_get( p_intf, pi_objects[i] );
+        p_object = pi_objects[i];
         if( p_object == NULL ) continue;
 
-        b_section_empty = VLC_FALSE;
+        b_section_empty = false;
         CreateMenuItem( p_intf, p_menu_list, hMenu, ppsz_varnames[i],
                         p_object, &i_item_id );
         vlc_object_release( p_object );
@@ -559,7 +552,7 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
         AppendMenu( hMenu, MF_STRING | MF_POPUP, (UINT)hMenuItem,
                     _FROMMB(text.psz_string ? text.psz_string : psz_var) );
         if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
@@ -569,7 +562,7 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
         AppendMenu( hMenu, MF_STRING , ++(*pi_item_id),
                     _FROMMB(text.psz_string ? text.psz_string : psz_var) );
         pMenuItemExt = new MenuItemExt( p_intf, *pi_item_id, psz_var,
-                                        p_object->i_object_id, val, i_type );
+                                        p_object, val, i_type );
         p_menu_list->push_back( pMenuItemExt );
         break;
 
@@ -578,24 +571,24 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
         AppendMenu( hMenu, MF_STRING | MF_CHECKED, ++(*pi_item_id),
                     _FROMMB(text.psz_string ? text.psz_string : psz_var) );
         pMenuItemExt = new MenuItemExt( p_intf, *pi_item_id, psz_var,
-                                        p_object->i_object_id, val, i_type );
+                                        p_object, val, i_type );
         p_menu_list->push_back( pMenuItemExt );
         CheckMenuItem( hMenu, *pi_item_id ,
                        ( val.b_bool ? MF_UNCHECKED : MF_CHECKED ) |
-                       MF_BYCOMMAND ); 
+                       MF_BYCOMMAND );
         break;
 
     default:
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
     if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
-    if( text.psz_string ) free( text.psz_string );
+    free( text.psz_string );
 }
 
 HMENU CreateChoicesMenu( intf_thread_t *p_intf,
-                         vector<MenuItemExt*> *p_menu_list, char *psz_var, 
+                         vector<MenuItemExt*> *p_menu_list, char *psz_var,
                          vlc_object_t *p_object, int *pi_item_id )
 {
     MenuItemExt *pMenuItemExt;
@@ -666,7 +659,7 @@ HMENU CreateChoicesMenu( intf_thread_t *p_intf,
                           text_list.p_list->p_values[i].psz_string :
                           val_list.p_list->p_values[i].psz_string) );
             pMenuItemExt = new MenuItemExt( p_intf, *pi_item_id, psz_var,
-                          p_object->i_object_id, another_val, i_type );
+                          p_object, another_val, i_type );
             p_menu_list->push_back( pMenuItemExt );
 
             if( !(i_type & VLC_VAR_ISCOMMAND) && val.psz_string &&
@@ -681,7 +674,7 @@ HMENU CreateChoicesMenu( intf_thread_t *p_intf,
                         _FROMMB(text_list.p_list->p_values[i].psz_string ?
                           text_list.p_list->p_values[i].psz_string : psz_tmp));
             pMenuItemExt = new MenuItemExt( p_intf, *pi_item_id, psz_var,
-                p_object->i_object_id, val_list.p_list->p_values[i], i_type );
+                p_object, val_list.p_list->p_values[i], i_type );
             p_menu_list->push_back( pMenuItemExt );
 
             if( val_list.p_list->p_values[i].i_int == val.i_int )
@@ -695,7 +688,7 @@ HMENU CreateChoicesMenu( intf_thread_t *p_intf,
 
     /* Clean up everything */
     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;
 }
@@ -735,7 +728,7 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
 
     if( p_intf->p_sys->p_audio_menu && !p_menuitemext )
     for( iter = p_intf->p_sys->p_audio_menu->begin();
-         iter != p_intf->p_sys->p_audio_menu->end(); iter++ ) 
+         iter != p_intf->p_sys->p_audio_menu->end(); iter++ )
         if( (*iter)->id == id )
         {
             p_menuitemext = *iter;
@@ -762,8 +755,7 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
 
     if( p_menuitemext )
     {
-        vlc_object_t *p_object = (vlc_object_t *)
-            vlc_object_get( p_intf, p_menuitemext->i_object_id );
+        vlc_object_t *p_object = p_menuitemext->p_object;
         if( p_object == NULL ) return;
 
         var_Set( p_object, p_menuitemext->psz_var, p_menuitemext->val );
@@ -790,22 +782,22 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
  * things.
  *****************************************************************************/
 MenuItemExt::MenuItemExt( intf_thread_t *p_intf, int _id, char *_psz_var,
-                          int _i_object_id, vlc_value_t _val, int _i_val_type )
+                          vlc_object_t * _p_object, vlc_value_t _val, int _i_val_type )
 {
     /* Initializations */
     id = _id;
     p_intf = p_intf;
     psz_var = strdup( _psz_var );
     i_val_type = _i_val_type;
-    i_object_id = _i_object_id;
+    p_object = _p_object;
     val = _val;
 };
 
 MenuItemExt::~MenuItemExt()
 {
-    if( psz_var ) free( psz_var );
-    if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
-        && val.psz_string ) free( val.psz_string );
+    free( psz_var );
+    if( ( i_val_type & VLC_VAR_TYPE ) == VLC_VAR_STRING )
+        free( val.psz_string );
 };
 
 void MenuItemExt::ClearList( vector<MenuItemExt*> *p_menu_list )