[vlc-commits] VlcPluginGtk: fix crash when running under nspluginwrapper

Cheng Sun git at videolan.org
Wed Dec 28 19:15:55 CET 2011


npapi-vlc | branch: master | Cheng Sun <chengsun9 at gmail.com> | Sat Dec 24 21:28:17 2011 +0000| [5d17eb48bf17493ab6f46efc04c96d96c29dedcb] | committer: Jean-Baptiste Kempf

VlcPluginGtk: fix crash when running under nspluginwrapper

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 npapi/vlcplugin_gtk.cpp |    8 ++------
 npapi/vlcplugin_gtk.h   |    3 ++-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/npapi/vlcplugin_gtk.cpp b/npapi/vlcplugin_gtk.cpp
index 24c6045..bba1493 100644
--- a/npapi/vlcplugin_gtk.cpp
+++ b/npapi/vlcplugin_gtk.cpp
@@ -48,12 +48,6 @@ VlcPluginGtk::~VlcPluginGtk()
 {
 }
 
-Display *VlcPluginGtk::get_display()
-{
-    return ( (NPSetWindowCallbackStruct *)
-             npwindow.ws_info )->display;
-}
-
 void VlcPluginGtk::set_player_window()
 {
     libvlc_media_player_set_xwindow(libvlc_media_player,
@@ -307,6 +301,8 @@ void VlcPluginGtk::update_controls()
 
 bool VlcPluginGtk::create_windows()
 {
+    display = ( (NPSetWindowCallbackStruct *) npwindow.ws_info )->display;
+
     Window socket = (Window) npwindow.window;
     GdkColor color_black;
     gdk_color_parse("black", &color_black);
diff --git a/npapi/vlcplugin_gtk.h b/npapi/vlcplugin_gtk.h
index ee144bd..b0f0d42 100644
--- a/npapi/vlcplugin_gtk.h
+++ b/npapi/vlcplugin_gtk.h
@@ -54,7 +54,7 @@ public:
     void resize_video_xwindow(GdkRectangle *rect);
 private:
     void set_player_window();
-    Display *get_display();
+    Display *get_display() { return display; }
 
     unsigned int     i_width, i_height;
     GtkWidget *parent, *parent_vbox, *video_container;
@@ -62,6 +62,7 @@ private:
     GtkWidget *fullscreen_win;
     gulong video_container_size_handler_id;
 
+    Display *display;
     Window video_xwindow;
     bool is_fullscreen, is_toolbar_visible;
 };



More information about the vlc-commits mailing list