From 5ad6c0a52d095423a11fbc75e22491768f808cc6 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Wed, 28 Apr 2010 00:46:19 +0200 Subject: [PATCH] Fixed video display with directx and multiple monitors. --- modules/video_output/msw/common.c | 5 +++-- modules/video_output/msw/directx.c | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c index ebc814acdb..fc11a167a3 100644 --- a/modules/video_output/msw/common.c +++ b/modules/video_output/msw/common.c @@ -368,7 +368,7 @@ void UpdateRects(vout_display_t *vd, if (!IntersectRect(&rect_dest_clipped, &rect_dest, &sys->rect_display)) { SetRectEmpty(&rect_src_clipped); - return; + goto exit; } #ifndef NDEBUG @@ -389,7 +389,7 @@ void UpdateRects(vout_display_t *vd, if ((rect_dest_clipped.right - rect_dest_clipped.left) == 0 || (rect_dest_clipped.bottom - rect_dest_clipped.top) == 0) { SetRectEmpty(&rect_src_clipped); - return; + goto exit; } /* src image dimensions */ @@ -444,6 +444,7 @@ void UpdateRects(vout_display_t *vd, CommonChangeThumbnailClip(vd, true); +exit: /* Signal the change in size/position */ sys->changes |= DX_POSITION_CHANGE; diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c index 827c81bd08..e676b05c26 100644 --- a/modules/video_output/msw/directx.c +++ b/modules/video_output/msw/directx.c @@ -58,6 +58,10 @@ #include "common.h" +#ifdef UNICODE +# error "Unicode mode not supported" +#endif + /***************************************************************************** * Module descriptor *****************************************************************************/ @@ -190,7 +194,7 @@ static int Open(vlc_object_t *object) HMODULE huser32 = GetModuleHandle(_T("USER32")); if (huser32) { sys->MonitorFromWindow = (void*)GetProcAddress(huser32, _T("MonitorFromWindow")); - sys->GetMonitorInfo = (void*)GetProcAddress(huser32, _T("GetMonitorInfoW")); + sys->GetMonitorInfo = (void*)GetProcAddress(huser32, _T("GetMonitorInfoA")); } else { sys->MonitorFromWindow = NULL; sys->GetMonitorInfo = NULL; @@ -588,7 +592,7 @@ static int DirectXOpenDDraw(vout_display_t *vd) if (sys->MonitorFromWindow) { HRESULT (WINAPI *OurDirectDrawEnumerateEx)(LPDDENUMCALLBACKEXA, LPVOID, DWORD); OurDirectDrawEnumerateEx = - (void *)GetProcAddress(sys->hddraw_dll, _T("DirectDrawEnumerateExW")); + (void *)GetProcAddress(sys->hddraw_dll, _T("DirectDrawEnumerateExA")); if (OurDirectDrawEnumerateEx) { char *device = var_GetString(vd, "directx-device"); @@ -1486,7 +1490,7 @@ static int FindDevicesCallback(vlc_object_t *object, char const *name, /* Enumerate displays */ HRESULT (WINAPI *OurDirectDrawEnumerateEx)(LPDDENUMCALLBACKEXA, LPVOID, DWORD) = - (void *)GetProcAddress(hddraw_dll, _T("DirectDrawEnumerateExW")); + (void *)GetProcAddress(hddraw_dll, _T("DirectDrawEnumerateExA")); if (OurDirectDrawEnumerateEx) OurDirectDrawEnumerateEx(DirectXEnumCallback2, item, DDENUM_ATTACHEDSECONDARYDEVICES); -- 2.39.2