[vlc-devel] commit: Do not assume xid and hwnd are in a union ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Mar 7 12:43:36 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar  7 13:42:18 2009 +0200| [c2eea782021026a4df45f0e2b828cef1970b37aa] | committer: Rémi Denis-Courmont 

Do not assume xid and hwnd are in a union

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

 src/control/media_player.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/control/media_player.c b/src/control/media_player.c
index 3e9c15e..d5faf65 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -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
 }
 
 /**************************************************************************




More information about the vlc-devel mailing list