]> git.sesse.net Git - vlc/commitdiff
Do not assume xid and hwnd are in a union
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 7 Mar 2009 11:42:18 +0000 (13:42 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 7 Mar 2009 11:42:18 +0000 (13:42 +0200)
src/control/media_player.c

index 3e9c15e063b012f237ba7ee7025f80c87b300c58..d5faf6505632b795d348be343af9c476b6de5a36 100644 (file)
@@ -765,7 +765,14 @@ void libvlc_media_player_set_drawable( libvlc_media_player_t *p_mi,
 {
     input_thread_t *p_input_thread;
 
+#ifdef WIN32
+    if (sizeof (HWND) <= sizeof (libvlc_drawable_t))
+        p_mi->drawable.hwnd = (HWND)drawable;
+    else
+        libvlc_exception_raise(p_e, "Operation not supported");
+#else
     p_mi->drawable.xid = drawable;
+#endif
 
     /* Allow on the fly drawable changing. This is tricky has this may
      * not be supported by every vout. We though can't disable it
@@ -789,7 +796,15 @@ libvlc_media_player_get_drawable ( libvlc_media_player_t *p_mi,
                                    libvlc_exception_t *p_e )
 {
     VLC_UNUSED(p_e);
+
+#ifdef WIN32
+    if (sizeof (HWND) <= sizeof (libvlc_drawable_t))
+        return (libvlc_drawable_t)p_mi->drawable.hwnd;
+    else
+        return 0;
+#else
     return p_mi->drawable.xid;
+#endif
 }
 
 /**************************************************************************