[Deinterlace-checkins] SF.net SVN: deinterlace:[4776] trunk/DScaler/DScaler
Brought to you by:
adcockj,
dschmelzer
From: <ad...@us...> - 2012-02-25 15:32:46
|
Revision: 4776 http://deinterlace.svn.sourceforge.net/deinterlace/?rev=4776&view=rev Author: adcockj Date: 2012-02-25 15:32:39 +0000 (Sat, 25 Feb 2012) Log Message: ----------- Possible fixes for issues with overlay reported on forum by Julian Modified Paths: -------------- trunk/DScaler/DScaler/OverlayOutput.cpp trunk/DScaler/DScaler/OverlayOutput.h Modified: trunk/DScaler/DScaler/OverlayOutput.cpp =================================================================== --- trunk/DScaler/DScaler/OverlayOutput.cpp 2012-02-18 16:00:29 UTC (rev 4775) +++ trunk/DScaler/DScaler/OverlayOutput.cpp 2012-02-25 15:32:39 UTC (rev 4776) @@ -47,7 +47,7 @@ MONITORINFO MonInfo; LPDIRECTDRAW lpDD; - if (NbMonitors == MAX_MONITORS) + if (NbMonitors == MAX_DSCALER_MONITORS) return DDENUMRET_CANCEL; // DirectDrawEnumerateEx returns hMonitor = NULL on single monitor configuration @@ -58,7 +58,7 @@ { hMonitor = OverlayOutputInstance.m_lpMonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY); } - LOG(2, _T("Monitor %d %s %s"), hMonitor, pszDesc, pszDriverName); + LOG(0, _T("Monitor %d %s %s"), hMonitor, pszDesc, pszDriverName); // and therefore test if we found again the same monitor ! for (int i = 0; i < NbMonitors; i++) @@ -91,13 +91,17 @@ static DynamicFunctionS3<HRESULT, LPDDENUMCALLBACKEX, LPVOID, DWORD> lpDDEnumEx(_T("ddraw.dll"), ADD_API_LETTER(DirectDrawEnumerateEx)); BOOL RetVal = TRUE; + NbMonitors = 0; + // Retrieve the function from the DirectDraw DLL if (lpDDEnumEx) { // If the function is there, call it to enumerate all display // devices attached to the desktop - if(lpDDEnumEx(DDEnumCallbackEx, NULL, DDENUM_ATTACHEDSECONDARYDEVICES) != DD_OK) + HRESULT hr = lpDDEnumEx(DDEnumCallbackEx, NULL, DDENUM_ATTACHEDSECONDARYDEVICES); + if(hr != DD_OK) { + LOG(0, _T("DDEnumEx failed %08x"), hr); RetVal = FALSE; } } @@ -117,7 +121,7 @@ if (FAILED(m_lpDirectDrawCreate(NULL, &lpDD, NULL))) { ErrorBox(_T("DirectDrawCreate failed")); - return (FALSE); + return NULL; } return lpDD; } @@ -132,7 +136,16 @@ return Monitors[i].lpDD; } } - return NULL; + + LOG(0, _T("Couldn't find correct monitor")); + + // fall back to standard DD create + if (FAILED(m_lpDirectDrawCreate(NULL, &lpDD, NULL))) + { + ErrorBox(_T("DirectDrawCreate failed")); + return NULL; + } + return lpDD; } //----------------------------------------------------------------------------- Modified: trunk/DScaler/DScaler/OverlayOutput.h =================================================================== --- trunk/DScaler/DScaler/OverlayOutput.h 2012-02-18 16:00:29 UTC (rev 4775) +++ trunk/DScaler/DScaler/OverlayOutput.h 2012-02-25 15:32:39 UTC (rev 4776) @@ -25,8 +25,8 @@ HMONITOR hMon; LPDIRECTDRAW lpDD; } TMonitor; -#define MAX_MONITORS 4 -static TMonitor Monitors[MAX_MONITORS]; +#define MAX_DSCALER_MONITORS 16 +static TMonitor Monitors[MAX_DSCALER_MONITORS]; static int NbMonitors=0; static HMONITOR hCurrentMon=0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |