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:
paibox 2013-12-22 17:41:42 +01:00
parent 70b5a7ca27
commit 0a86949d29
2 changed files with 8 additions and 5 deletions

View File

@ -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->SetString(TEXT("deviceID"), configData->deviceIDList[deviceID]);
configData->data->SetInt(TEXT("customResolution"), bCustomResolution); 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_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->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("resolutionWidth"), resolution.cx);
configData->data->SetInt(TEXT("resolutionHeight"), resolution.cy); configData->data->SetInt(TEXT("resolutionHeight"), resolution.cy);
configData->data->SetInt(TEXT("frameInterval"), UINT(frameInterval)); 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("gamma"), (int)SendMessage(GetDlgItem(hwnd, IDC_GAMMA), TBM_GETPOS, 0, 0));
configData->data->SetInt(TEXT("preserveSourceSize"), bPreserveSourceSize); 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("deinterlacingType"), deinterlacingConfig.type);
configData->data->SetInt(TEXT("deinterlacingFieldOrder"), deinterlacingConfig.fieldOrder); configData->data->SetInt(TEXT("deinterlacingFieldOrder"), deinterlacingConfig.fieldOrder);

View File

@ -875,8 +875,10 @@ cleanFinish:
else else
bReadyToDraw = false; bReadyToDraw = false;
if(!renderCX) {renderCX = 32; imageCX = renderCX;} // Updated check to ensure that the source actually turns red instead of
if(!renderCY) {renderCY = 32; imageCY = renderCY;} // 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;
//----------------------------------------------------- //-----------------------------------------------------