qedit: In SampleGrabber ReceiveConnection check early the format type, return VFW_E_INVALIDMEDIATYPE like native.
This commit is contained in:
parent
e3c0e30db1
commit
5650a9eb8b
|
@ -1048,6 +1048,10 @@ SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_M
|
|||
debugstr_guid(&type->majortype), debugstr_guid(&type->subtype),
|
||||
type->lSampleSize,
|
||||
debugstr_guid(&type->formattype), type->cbFormat);
|
||||
if (!IsEqualGUID(&type->formattype, &FORMAT_None) &&
|
||||
!IsEqualGUID(&type->formattype, &GUID_NULL) &&
|
||||
!type->pbFormat)
|
||||
return VFW_E_INVALIDMEDIATYPE;
|
||||
if (!IsEqualGUID(&This->sg->mtype.majortype,&GUID_NULL) &&
|
||||
!IsEqualGUID(&This->sg->mtype.majortype,&type->majortype))
|
||||
return VFW_E_TYPE_NOT_ACCEPTED;
|
||||
|
@ -1058,10 +1062,6 @@ SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_M
|
|||
!IsEqualGUID(&This->sg->mtype.formattype,&FORMAT_None) &&
|
||||
!IsEqualGUID(&This->sg->mtype.formattype,&type->formattype))
|
||||
return VFW_E_TYPE_NOT_ACCEPTED;
|
||||
if (!IsEqualGUID(&type->formattype, &FORMAT_None) &&
|
||||
!IsEqualGUID(&type->formattype, &GUID_NULL) &&
|
||||
!type->pbFormat)
|
||||
return VFW_E_TYPE_NOT_ACCEPTED;
|
||||
if (This->sg->mtype.pbFormat)
|
||||
CoTaskMemFree(This->sg->mtype.pbFormat);
|
||||
This->sg->mtype = *type;
|
||||
|
|
Loading…
Reference in New Issue