Minor DirectShow fix
Ensure that the DirectShow texture actually ends up being the red 32x32 texture rather than cx and cy somehow getting set to 1.#INF when SetFormat fails.
This commit is contained in:
parent
70b5a7ca27
commit
0a86949d29
@ -2035,8 +2035,10 @@ INT_PTR CALLBACK ConfigureDialogProc(HWND hwnd, UINT message, WPARAM wParam, LPA
|
||||
configData->data->SetString(TEXT("deviceID"), configData->deviceIDList[deviceID]);
|
||||
|
||||
configData->data->SetInt(TEXT("customResolution"), bCustomResolution);
|
||||
if(resolution.cx != 0 && resolution.cy != 0) {
|
||||
configData->data->SetFloat(TEXT("scaleFactor_x"), (float)resolution.cx / configData->data->GetFloat(TEXT("resolutionWidth"), 1.0f));
|
||||
configData->data->SetFloat(TEXT("scaleFactor_y"), (float)resolution.cy / configData->data->GetFloat(TEXT("resolutionHeight"), 1.0f));
|
||||
}
|
||||
configData->data->SetInt(TEXT("resolutionWidth"), resolution.cx);
|
||||
configData->data->SetInt(TEXT("resolutionHeight"), resolution.cy);
|
||||
configData->data->SetInt(TEXT("frameInterval"), UINT(frameInterval));
|
||||
@ -2046,7 +2048,6 @@ INT_PTR CALLBACK ConfigureDialogProc(HWND hwnd, UINT message, WPARAM wParam, LPA
|
||||
configData->data->SetInt(TEXT("gamma"), (int)SendMessage(GetDlgItem(hwnd, IDC_GAMMA), TBM_GETPOS, 0, 0));
|
||||
|
||||
configData->data->SetInt(TEXT("preserveSourceSize"), bPreserveSourceSize);
|
||||
configData->data->SetFloat(TEXT("scaleRatio"), (float)resolution.cx / configData->data->GetFloat(TEXT("resolutionWidth"), 1.0f));
|
||||
|
||||
configData->data->SetInt(TEXT("deinterlacingType"), deinterlacingConfig.type);
|
||||
configData->data->SetInt(TEXT("deinterlacingFieldOrder"), deinterlacingConfig.fieldOrder);
|
||||
|
@ -875,8 +875,10 @@ cleanFinish:
|
||||
else
|
||||
bReadyToDraw = false;
|
||||
|
||||
if(!renderCX) {renderCX = 32; imageCX = renderCX;}
|
||||
if(!renderCY) {renderCY = 32; imageCY = renderCY;}
|
||||
// Updated check to ensure that the source actually turns red instead of
|
||||
// screwing up the size when SetFormat fails.
|
||||
if(renderCX <= 0 || renderCX >= 8192) renderCX = 32; imageCX = renderCX;
|
||||
if(renderCY <= 0 || renderCY >= 8192) renderCY = 32; imageCY = renderCY;
|
||||
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user