quartz: Handle case where ReceiveConnection is called on an already connected pin.

This commit is contained in:
Maarten Lankhorst 2008-06-22 00:57:47 -07:00 committed by Alexandre Julliard
parent 99deb5ca2c
commit cdb66444ed
1 changed files with 3 additions and 3 deletions

View File

@ -1287,6 +1287,7 @@ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const
dump_AM_MEDIA_TYPE(pmt);
EnterCriticalSection(This->pin.pCritSec);
if (!This->pin.pConnectedTo)
{
ALLOCATOR_PROPERTIES props;
@ -1295,9 +1296,6 @@ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const
props.cbAlign = 1;
props.cbPrefix = 0;
if (This->pin.pConnectedTo)
hr = VFW_E_ALREADY_CONNECTED;
if (SUCCEEDED(hr) && (This->pin.fnQueryAccept(This->pin.pUserData, pmt) != S_OK))
hr = VFW_E_TYPE_NOT_ACCEPTED; /* FIXME: shouldn't we just map common errors onto
* VFW_E_TYPE_NOT_ACCEPTED and pass the value on otherwise? */
@ -1349,6 +1347,8 @@ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const
This->pAlloc = NULL;
}
}
else
hr = VFW_E_ALREADY_CONNECTED;
LeaveCriticalSection(This->pin.pCritSec);
return hr;
}