]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/iteminfo.cpp
Use pl_Yield and pl_Release instead of vlc_object_find.
[vlc] / modules / gui / wince / iteminfo.cpp
index 8abf79b5647e51bdbfaa3328288c98760e5efcbc..160f72a2103cdc9731c20a295e05c8f4f3eefeee 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <vlc_interface.h>
 
 #include "wince.h"
@@ -252,7 +256,7 @@ LRESULT ItemInfoDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
  *****************************************************************************/
 void ItemInfoDialog::OnOk()
 {
-    int b_state = VLC_FALSE;
+    int b_state = false;
 
     TCHAR psz_name[MAX_PATH];
     Edit_GetText( name_text, psz_name, MAX_PATH );
@@ -263,22 +267,16 @@ void ItemInfoDialog::OnOk()
     input_item_SetURI( &p_item->input, _TOMB(psz_uri) );
 
     vlc_mutex_lock( &p_item->input.lock );
-    vlc_bool_t b_old_enabled = p_item->b_enabled;
+    bool b_old_enabled = p_item->b_enabled;
 
-    playlist_t * p_playlist = (playlist_t *)
-        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    playlist_t * p_playlist = pl_Yield( p_intf );
     if( p_playlist != NULL )
     {
         b_state = SendMessage( enabled_checkbox, BM_GETCHECK, 0, 0 );
-        if( b_old_enabled == VLC_FALSE && (b_state & BST_CHECKED) )
-            p_playlist->i_enabled ++;
-        else if( b_old_enabled == VLC_TRUE && (b_state & BST_UNCHECKED) )
-            p_playlist->i_enabled --;
-
-        vlc_object_release( p_playlist );
+        pl_Release( p_playlist );
     }
 
-    p_item->b_enabled = (b_state & BST_CHECKED) ? VLC_TRUE : VLC_FALSE ;
+    p_item->b_enabled = (b_state & BST_CHECKED) ? true : false ;
 
     vlc_mutex_unlock( &p_item->input.lock );
 }