[vlc-devel] commit: Reparenting does not work with set_parent. ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 13 19:55:35 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 13 20:52:06 2009 +0300| [f1582740f8c3b7647e7391ccf7f476ce26846c5f] | committer: Rémi Denis-Courmont 

Reparenting does not work with set_parent.

It did not work in 1.0 either, and it was not safe in earlier versions.
Nobody ever bothered to implement thread-safe reparenting. Calling
libvlc_video_set_parent() is useless in 1.0: It has the same effect
as calling proper libvlc_media_player_set_*(), which the Mozilla
plugin already does.

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

 projects/mozilla/vlcshell.cpp |   24 ------------------------
 1 files changed, 0 insertions(+), 24 deletions(-)

diff --git a/projects/mozilla/vlcshell.cpp b/projects/mozilla/vlcshell.cpp
index 151c615..e0b937b 100644
--- a/projects/mozilla/vlcshell.cpp
+++ b/projects/mozilla/vlcshell.cpp
@@ -387,12 +387,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     {
         /* check if plugin has a new parent window */
         CGrafPtr drawable = (((NP_Port*) (window->window))->port);
-        if( !curwin.window || drawable != (((NP_Port*) (curwin.window))->port) )
-        {
-            /* set/change parent window */
-            libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, &ex);
-            libvlc_exception_clear(&ex);
-        }
 
         /* as MacOS X video output is windowless, set viewport */
         libvlc_rectangle_t view, clip;
@@ -422,9 +416,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     else if( curwin.window )
     {
         /* change/set parent */
-        libvlc_video_set_parent(p_vlc, 0, &ex);
-        libvlc_exception_clear(&ex);
-
         curwin.window = NULL;
     }
 #endif /* XP_MACOSX */
@@ -457,10 +448,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
             style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
             SetWindowLong((HWND)drawable, GWL_STYLE, style);
 
-            /* change/set parent */
-            libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, &ex);
-            libvlc_exception_clear(&ex);
-
             /* remember new window */
             p_plugin->setWindow(*window);
 
@@ -476,10 +463,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
         SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) );
         p_plugin->setWindowProc(NULL);
 
-        /* change/set parent */
-        libvlc_video_set_parent(p_vlc, 0, &ex);
-        libvlc_exception_clear(&ex);
-
         curwin.window = NULL;
     }
 #endif /* XP_WIN */
@@ -529,10 +512,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
             XtAddEventHandler( w, ButtonReleaseMask, FALSE,
                                (XtEventHandler)ControlHandler, p_plugin );
 
-            /* set/change parent window */
-            libvlc_video_set_parent( p_vlc, (libvlc_drawable_t) video, &ex );
-            libvlc_exception_clear(&ex);
-
             /* remember window */
             p_plugin->setWindow( *window );
             p_plugin->setVideoWindow( video );
@@ -553,9 +532,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     }
     else if( curwin.window )
     {
-        /* change/set parent */
-        libvlc_video_set_parent(p_vlc, 0, &ex);
-        libvlc_exception_clear(&ex);
         curwin.window = NULL;
     }
 #endif /* XP_UNIX */




More information about the vlc-devel mailing list