]> git.sesse.net Git - vlc/commitdiff
vout_window_t: privatize module pointer
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 17 Oct 2009 17:40:55 +0000 (20:40 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 17 Oct 2009 17:40:55 +0000 (20:40 +0300)
include/vlc_vout_window.h
src/video_output/window.c

index b3db0818fc61522acb2e02bb28d4b5fe1f517d24..a3615cdbdbbe2d1a32f727cc6e26092a6077e497 100644 (file)
@@ -78,9 +78,6 @@ typedef struct {
 struct vout_window_t {
     VLC_COMMON_MEMBERS
 
-    /* Module */
-    module_t *module;
-
     /* Initial state (reserved).
      * Once the open function is called, it will be set to NULL
      */
index 3076401bc4015e22d0587fa0accbfdb13b73a5e6..503006b189edb6e0ee7883233c7b2466e7ca13b7 100644 (file)
 #include <vlc_vout_window.h>
 #include <libvlc.h>
 
+typedef struct
+{
+    vout_window_t wnd;
+    module_t *module;
+} window_t;
+
 vout_window_t *vout_window_New(vlc_object_t *obj,
                                const char *module,
                                const vout_window_cfg_t *cfg)
 {
     static char const name[] = "window";
-    vout_window_t *window = vlc_custom_create(obj, sizeof(*window),
-                                              VLC_OBJECT_GENERIC, name);
+    window_t *w = vlc_custom_create(obj, sizeof(*w), VLC_OBJECT_GENERIC, name);
+    vout_window_t *window = &w->wnd;
+
     window->cfg = cfg;
     memset(&window->handle, 0, sizeof(window->handle));
     window->control = NULL;
@@ -59,9 +66,8 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
         assert(0);
     }
 
-    window->module = module_need(window, type,
-                                 module, module && *module != '\0');
-    if (!window->module) {
+    w->module = module_need(window, type, module, module && *module != '\0');
+    if (!w->module) {
         vlc_object_detach(window);
         vlc_object_release(window);
         return NULL;
@@ -74,9 +80,10 @@ void vout_window_Delete(vout_window_t *window)
     if (!window)
         return;
 
+    window_t *w = (window_t *)window;
     vlc_object_detach(window);
 
-    module_unneed(window, window->module);
+    module_unneed(window, w->module);
 
     vlc_object_release(window);
 }