[vlc-commits] vout: win32: drawable: store a HWND in the known hwnd table
Steve Lhomme
git at videolan.org
Mon May 11 09:14:06 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu May 7 14:09:08 2020 +0200| [8c1f8b1c47232ca90809f3ec5bb363210210be11] | committer: Steve Lhomme
vout: win32: drawable: store a HWND in the known hwnd table
No need to do more casts. A HWND is pointer anyway.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8c1f8b1c47232ca90809f3ec5bb363210210be11
---
modules/video_output/drawable.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/modules/video_output/drawable.c b/modules/video_output/drawable.c
index f9db604d56..7417900bc7 100644
--- a/modules/video_output/drawable.c
+++ b/modules/video_output/drawable.c
@@ -58,13 +58,13 @@ vlc_module_end ()
/* Keep a list of busy drawables, so we don't overlap videos if there are
* more than one video track in the stream. */
static vlc_mutex_t serializer = VLC_STATIC_MUTEX;
-static uintptr_t *used = NULL;
+static HWND *used = NULL;
static const struct vout_window_operations ops = {
.destroy = Close,
};
-static void RemoveDrawable(uintptr_t val)
+static void RemoveDrawable(HWND val)
{
size_t n = 0;
@@ -93,11 +93,12 @@ static void RemoveDrawable(uintptr_t val)
*/
static int Open(vout_window_t *wnd)
{
- uintptr_t val = var_InheritInteger (wnd, "drawable-hwnd");
- if (val == 0)
+ uintptr_t drawable = var_InheritInteger (wnd, "drawable-hwnd");
+ if (drawable == 0)
return VLC_EGENERIC;
+ HWND val = (HWND)drawable;
- uintptr_t *tab;
+ HWND *tab;
size_t n = 0;
vlc_mutex_lock (&serializer);
@@ -105,7 +106,7 @@ static int Open(vout_window_t *wnd)
for (/*n = 0*/; used[n]; n++)
if (used[n] == val)
{
- msg_Warn (wnd, "HWND 0x%" PRIXPTR " is busy", val);
+ msg_Warn (wnd, "HWND 0x%p is busy", val);
val = 0;
goto skip;
}
@@ -137,7 +138,7 @@ skip:
*/
static void Close (vout_window_t *wnd)
{
- uintptr_t val = (uintptr_t)wnd->sys;
+ HWND val = (HWND) wnd->handle.hwnd;
RemoveDrawable(val);
}
More information about the vlc-commits
mailing list