Fixed a crash with thread creation in DShowPlugin
parent
093ef3eedb
commit
d3102d28f5
|
@ -403,13 +403,6 @@ bool DeviceSource::LoadFilters()
|
|||
AppWarning(TEXT("DShowPlugin: Could not create color space conversion pixel shader"));
|
||||
goto cleanFinish;
|
||||
}
|
||||
|
||||
int numThreads = MAX(OSGetTotalCores()-2, 1);
|
||||
if(colorType == DeviceOutputType_YV12 || colorType == DeviceOutputType_I420)
|
||||
{
|
||||
for(int i=0; i<numThreads; i++)
|
||||
hConvertThreads[i] = OSCreateThread((XTHREAD)PackPlanarThread, convertData+i);
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// set chroma details
|
||||
|
@ -659,6 +652,7 @@ bool DeviceSource::LoadFilters()
|
|||
renderCX *= 2;
|
||||
}
|
||||
|
||||
int numThreads = MAX(OSGetTotalCores()-2, 1);
|
||||
for(int i=0; i<numThreads; i++)
|
||||
{
|
||||
convertData[i].width = lineSize;
|
||||
|
@ -680,6 +674,12 @@ bool DeviceSource::LoadFilters()
|
|||
convertData[i].endY = ((renderCY/numThreads)*(i+1)) & 0xFFFFFFFE;
|
||||
}
|
||||
|
||||
if(colorType == DeviceOutputType_YV12 || colorType == DeviceOutputType_I420)
|
||||
{
|
||||
for(int i=0; i<numThreads; i++)
|
||||
hConvertThreads[i] = OSCreateThread((XTHREAD)PackPlanarThread, convertData+i);
|
||||
}
|
||||
|
||||
bSucceeded = true;
|
||||
|
||||
cleanFinish:
|
||||
|
|
|
@ -35,8 +35,8 @@ void PackPlanar(LPBYTE convertBuffer, LPBYTE lpPlanar, UINT renderCX, UINT rende
|
|||
{
|
||||
LPBYTE lpLum1 = input + y*2*linePitch;
|
||||
LPBYTE lpLum2 = lpLum1 + linePitch;
|
||||
LPBYTE lpChroma1 = input2 + y*linePitch/2;
|
||||
LPBYTE lpChroma2 = input3 + y*linePitch/2;
|
||||
LPBYTE lpChroma1 = input2 + y*(linePitch/2);
|
||||
LPBYTE lpChroma2 = input3 + y*(linePitch/2);
|
||||
LPDWORD output1 = (LPDWORD)(output + (y*2)*pitch);
|
||||
LPDWORD output2 = (LPDWORD)(((LPBYTE)output1)+pitch);
|
||||
|
||||
|
|
Loading…
Reference in New Issue