From 4b04ca082c0d4e719e6d636bc84f3c4a42331d21 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 17 Jul 2008 17:37:51 -0700 Subject: [PATCH] quartz: Fix bugs that occur during connection of output pins --- dlls/quartz/pin.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/quartz/pin.c b/dlls/quartz/pin.c index 5daaf7e..e2b868e 100644 --- a/dlls/quartz/pin.c +++ b/dlls/quartz/pin.c @@ -192,19 +192,15 @@ static HRESULT OutputPin_ConnectSpecific(IPin * iface, IPin * pReceivePin, const hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pMemAlloc); if (hr == VFW_E_NO_ALLOCATOR) - { /* Input pin provides no allocator, use standard memory allocator */ hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (LPVOID*)&pMemAlloc); - if (SUCCEEDED(hr)) - { - hr = IMemInputPin_NotifyAllocator(This->pMemInputPin, pMemAlloc, This->readonly); - } - } - if (SUCCEEDED(hr)) hr = IMemAllocator_SetProperties(pMemAlloc, &This->allocProps, &actual); + if (SUCCEEDED(hr)) + hr = IMemInputPin_NotifyAllocator(This->pMemInputPin, pMemAlloc, This->readonly); + if (pMemAlloc) IMemAllocator_Release(pMemAlloc); } @@ -940,7 +936,9 @@ HRESULT WINAPI OutputPin_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDI while (S_OK == IEnumMediaTypes_Next(pEnumCandidates, 1, &pmtCandidate, NULL)) { assert(pmtCandidate); - if (!IsEqualGUID(&FORMAT_None, &pmtCandidate->formattype)) + dump_AM_MEDIA_TYPE(pmtCandidate); + if (!IsEqualGUID(&FORMAT_None, &pmtCandidate->formattype) + && !IsEqualGUID(&GUID_NULL, &pmtCandidate->formattype)) assert(pmtCandidate->pbFormat); if (( !pmt || CompareMediaTypes(pmt, pmtCandidate, TRUE) ) && (This->pConnectSpecific(iface, pReceivePin, pmtCandidate) == S_OK)) @@ -963,7 +961,9 @@ HRESULT WINAPI OutputPin_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDI while (S_OK == IEnumMediaTypes_Next(pEnumCandidates, 1, &pmtCandidate, NULL)) { assert(pmtCandidate); - if (!IsEqualGUID(&FORMAT_None, &pmtCandidate->formattype)) + dump_AM_MEDIA_TYPE(pmtCandidate); + if (!IsEqualGUID(&FORMAT_None, &pmtCandidate->formattype) + && !IsEqualGUID(&GUID_NULL, &pmtCandidate->formattype)) assert(pmtCandidate->pbFormat); if (( !pmt || CompareMediaTypes(pmt, pmtCandidate, TRUE) ) && (This->pConnectSpecific(iface, pReceivePin, pmtCandidate) == S_OK)) -- 1.5.4.1