[vlc-devel] commit: the vout might still run after the playlist termination, so we don' t want to use pl_Yield. Pointed by courmisch, thanks! ( Felix Paul Kühne )

git version control git at videolan.org
Sun Jun 15 23:30:26 CEST 2008


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jun 15 16:39:59 2008 +0200| [025c96ac36d5c8b98615e7de945f7d15284d3d41]

the vout might still run after the playlist termination, so we don't want to use pl_Yield. Pointed by courmisch, thanks!

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=025c96ac36d5c8b98615e7de945f7d15284d3d41
---

 modules/video_output/caca.c        |   10 +++++++---
 modules/video_output/msw/directx.c |   16 ++++++++++------
 modules/video_output/msw/events.c  |   24 ++++++++++++++++--------
 3 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index 0a8408c..888414a 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -371,9 +371,13 @@ static int Manage( vout_thread_t *p_vout )
             break;
         case CACA_EVENT_QUIT:
         {
-            p_playlist = pl_Yield( p_vout );
-            playlist_Stop( p_playlist );
-            vlc_object_release( p_playlist );
+            p_playlist = vlc_object_find( p_vout,
+                                         VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+            if( p_playlist )
+            {
+                playlist_Stop( p_playlist );
+                vlc_object_release( p_playlist );
+            }
             vlc_object_kill( p_vout->p_libvlc );
             break;
         }
diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index 084968d..cd8ed73 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -2125,12 +2125,16 @@ static int WallpaperCallback( vlc_object_t *p_this, char const *psz_cmd,
     {
         playlist_t *p_playlist;
 
-        p_playlist = pl_Yield( p_this );
-        /* Modify playlist as well because the vout might have to be
-         * restarted */
-        var_Create( p_playlist, "directx-wallpaper", VLC_VAR_BOOL );
-        var_Set( p_playlist, "directx-wallpaper", newval );
-        vlc_object_release( p_playlist );
+        p_playlist = vlc_object_find( p_this,
+                                     VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        if( p_playlist )
+        {
+            /* Modify playlist as well because the vout might have to be
+             * restarted */
+            var_Create( p_playlist, "directx-wallpaper", VLC_VAR_BOOL );
+            var_Set( p_playlist, "directx-wallpaper", newval );
+            vlc_object_release( p_playlist );
+        }
 
         p_vout->p_sys->i_changes |= DX_WALLPAPER_CHANGE;
     }
diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index 8ee36bf..5467ca5 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -77,11 +77,15 @@ 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 = 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 );
+    playlist_t *p_playlist = vlc_object_find( p_event,
+                                             VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    if( p_playlist )
+    {
+        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 );
@@ -866,9 +870,13 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
     /* the user wants to close the window */
     case WM_CLOSE:
     {
-        playlist_t * p_playlist = pl_Yield( p_vout );
-        playlist_Stop( p_playlist );
-        vlc_object_release( p_playlist );
+        playlist_t * p_playlist = vlc_object_find( p_vout,
+                                                  VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        if( p_playlist )
+        {
+            playlist_Stop( p_playlist );
+            vlc_object_release( p_playlist );
+        }
         return 0;
     }
 




More information about the vlc-devel mailing list