]> git.sesse.net Git - vlc/blobdiff - modules/misc/osd/osd_menu.c
macosx: Fix controller playlist toggling to use the contentRect and not the window...
[vlc] / modules / misc / osd / osd_menu.c
index bbd1719c4e0575d42d5624fed9c7b2c3a3959d81..a370703deb433bb7bd902c876e149f66881b352f 100644 (file)
@@ -2,7 +2,7 @@
  * parser.c : OSD import module
  *****************************************************************************
  * Copyright (C) 2007 M2X
- * $Id$
+ * $Id$
  *
  * Authors: Jean-Paul Saman
  *
  * Preamble
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <vlc_vout.h>
 #include <vlc_config.h>
 
@@ -78,8 +82,8 @@ void osd_MenuFree( osd_menu_t *p_menu )
     msg_Dbg( p_menu, "freeing menu" );
     osd_ButtonFree( p_menu, p_menu->p_button );
 
-    if( p_menu->psz_path ) free( p_menu->psz_path );
-    if( p_menu->p_state ) free( p_menu->p_state );
+    free( p_menu->psz_path );
+    free( p_menu->p_state );
 
     p_menu->p_button = NULL;
     p_menu->p_last_button = NULL;
@@ -131,18 +135,15 @@ void osd_ButtonFree( osd_menu_t *p_menu, osd_button_t *p_button )
         p_current = p_prev;
         if( p_current->p_next )
         {
-            if( p_current->p_next->psz_name )
-                free( p_current->p_next->psz_name );
-            if( p_current->p_next->psz_action )
-                free( p_current->p_next->psz_action );
-            if( p_current->p_next->psz_action_down )
-                free( p_current->p_next->psz_action_down );
-            if( p_current->p_feedback && p_current->p_feedback->p_data_orig )
-                free( p_current->p_feedback->p_data_orig );
+            free( p_current->p_next->psz_name );
+            free( p_current->p_next->psz_action );
+            free( p_current->p_next->psz_action_down );
             if( p_current->p_feedback )
+            {
+                free( p_current->p_feedback->p_data_orig );
                 free( p_current->p_feedback );
-
-            p_current->p_feedback = NULL;
+                p_current->p_feedback = NULL;
+            }
 
             /* Free all states first */
             if( p_current->p_next->p_states )
@@ -154,16 +155,14 @@ void osd_ButtonFree( osd_menu_t *p_menu, osd_button_t *p_button )
 
         if( p_current->p_up )
         {
-            if( p_current->p_up->psz_name )
-                free( p_current->p_up->psz_name );
-            if( p_current->p_up->psz_action )
-                free( p_current->p_up->psz_action );
-            if( p_current->p_up->psz_action_down )
-                free( p_current->p_up->psz_action_down );
-            if( p_current->p_feedback && p_current->p_feedback->p_data_orig )
-                free( p_current->p_feedback->p_data_orig );
+            free( p_current->p_up->psz_name );
+            free( p_current->p_up->psz_action );
+            free( p_current->p_up->psz_action_down );
             if( p_current->p_feedback )
+            {
+                free( p_current->p_feedback->p_data_orig );
                 free( p_current->p_feedback );
+            }
 
             p_current->p_feedback = NULL;
 
@@ -179,14 +178,15 @@ void osd_ButtonFree( osd_menu_t *p_menu, osd_button_t *p_button )
     {
         msg_Dbg( p_menu, "+ freeing button %s [%p]",
                  p_button->psz_action, p_button );
-        if( p_button->psz_name ) free( p_button->psz_name );
-        if( p_button->psz_action ) free( p_button->psz_action );
-        if( p_button->psz_action_down ) free( p_button->psz_action_down );
-        if( p_current->p_feedback && p_current->p_feedback->p_data_orig )
-            free( p_current->p_feedback->p_data_orig );
+        free( p_button->psz_name );
+        free( p_button->psz_action );
+        free( p_button->psz_action_down );
         if( p_current->p_feedback )
+        {
+            free( p_current->p_feedback->p_data_orig );
             free( p_current->p_feedback );
-        p_current->p_feedback = NULL;
+            p_current->p_feedback = NULL;
+        }
 
         if( p_button->p_states )
             osd_StatesFree( p_menu, p_button->p_states );
@@ -264,12 +264,10 @@ void osd_StatesFree( osd_menu_t *p_menu, osd_state_t *p_states )
         {
             if( p_state->p_next->p_pic )
             {
-                if( p_state->p_next->p_pic->p_data_orig )
-                    free( p_state->p_next->p_pic->p_data_orig );
+                free( p_state->p_next->p_pic->p_data_orig );
                 free( p_state->p_next->p_pic );
             }
-            if( p_state->p_next->psz_state )
-                free( p_state->p_next->psz_state );
+            free( p_state->p_next->psz_state );
             free( p_state->p_next );
             p_state->p_next = NULL;
         }
@@ -281,11 +279,10 @@ void osd_StatesFree( osd_menu_t *p_menu, osd_state_t *p_states )
                  p_state->psz_state, p_states );
         if( p_states->p_pic )
         {
-            if( p_states->p_pic->p_data_orig )
-                free( p_states->p_pic->p_data_orig );
+            free( p_states->p_pic->p_data_orig );
             free( p_states->p_pic );
         }
-        if( p_state->psz_state ) free( p_state->psz_state );
+        free( p_state->psz_state );
         free( p_states );
         p_states = NULL;
     }