]> git.sesse.net Git - vlc/blobdiff - src/osd/osd.c
macosx: Fix controller playlist toggling to use the contentRect and not the window...
[vlc] / src / osd / osd.c
index 0cdaed8166a0130a284a207181975871c99a5602..97ade75c2b917c16f4d38c9c587be1d9e3069bad 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_keys.h>
 #include <vlc_osd.h>
 #include <vlc_image.h>
@@ -72,11 +72,8 @@ static osd_menu_t *osd_ParserLoad( vlc_object_t *p_this, const char *psz_file )
     p_menu = vlc_custom_create( p_this, sizeof( *p_menu ), VLC_OBJECT_OSDMENU,
                                 osdmenu_name );
     if( !p_menu )
-    {
-        msg_Err( p_this, "out of memory" );
         return NULL;
-    }
-    vlc_object_yield( p_menu );
+
     vlc_object_attach( p_menu, p_this->p_libvlc );
 
     /* Stuff needed for Parser */
@@ -233,7 +230,7 @@ void __osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd )
     vlc_mutex_lock( lockval.p_address );
 
     vlc_object_release( p_osd );
-    if( p_osd->p_internals->i_refcount > 0 )
+    if( vlc_internals( VLC_OBJECT(p_osd) )->i_refcount > 0 )
     {
         vlc_mutex_unlock( lockval.p_address );
         return;
@@ -709,9 +706,9 @@ void __osd_Volume( vlc_object_t *p_this )
             osd_SetMenuUpdate( p_osd, true );
             osd_SetMenuVisible( p_osd, true );
         }
-        vlc_object_release( (vlc_object_t*) p_osd );
         vlc_mutex_unlock( lockval.p_address );
     }
+    vlc_object_release( p_osd );
 }
 
 osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
@@ -731,7 +728,7 @@ osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
 
     if( osd_isVisible( p_osd ) == false )
     {
-        vlc_object_release( (vlc_object_t*) p_osd );
+        vlc_object_release( p_osd );
         return NULL;
     }
 
@@ -784,13 +781,13 @@ osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
         if( ( i_x >= i_x_offset ) && ( i_x <= i_x_offset + i_width ) &&
             ( i_y >= i_y_offset ) && ( i_y <= i_y_offset + i_height ) )
         {
-            vlc_object_release( (vlc_object_t*) p_osd );
+            vlc_object_release( p_osd );
             vlc_mutex_unlock( lockval.p_address );
             return p_button;
         }
     }
 
-    vlc_object_release( (vlc_object_t*) p_osd );
+    vlc_object_release( p_osd );
     vlc_mutex_unlock( lockval.p_address );
     return NULL;
 }
@@ -842,6 +839,6 @@ void __osd_ButtonSelect( vlc_object_t *p_this, osd_button_t *p_button )
     msg_Dbg( p_osd, "button selected is [button %s]", p_osd->p_state->p_visible->psz_action );
 #endif
 
-    vlc_object_release( (vlc_object_t*) p_osd );
+    vlc_object_release( p_osd );
     vlc_mutex_unlock( lockval.p_address );
 }