]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/events.c
Replaced a certain amount of vlc_object_find by pl_Yield
[vlc] / modules / video_output / msw / events.c
index 7987ab283f6499b5a8b3714066f1f5e68c267493..8ee36bf5a455830614b3db3d5a5afd0b6906f58d 100644 (file)
@@ -77,15 +77,11 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args );
 
 static void DirectXPopupMenu( event_thread_t *p_event, bool b_open )
 {
-    playlist_t *p_playlist =
-        vlc_object_find( p_event, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-    if( p_playlist != NULL )
-    {
-        vlc_value_t val;
-        val.b_bool = b_open;
-        var_Set( p_playlist, "intf-popupmenu", val );
-        vlc_object_release( p_playlist );
-    }
+    playlist_t *p_playlist = pl_Yield( p_event );
+    vlc_value_t val;
+    val.b_bool = b_open;
+    var_Set( p_playlist, "intf-popupmenu", val );
+    vlc_object_release( p_playlist );
 }
 
 static int DirectXConvertKey( int i_key );
@@ -870,14 +866,7 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
     /* the user wants to close the window */
     case WM_CLOSE:
     {
-        playlist_t * p_playlist =
-            (playlist_t *)vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST,
-                                           FIND_ANYWHERE );
-        if( p_playlist == NULL )
-        {
-            return 0;
-        }
-
+        playlist_t * p_playlist = pl_Yield( p_vout );
         playlist_Stop( p_playlist );
         vlc_object_release( p_playlist );
         return 0;