[QUARTZ] Small fix + Reconnect function

Maarten Lankhorst m.b.lankhorst at gmail.com
Wed May 18 06:39:32 CDT 2005


ChangeLog:
Fixed unlawful freeing of mediatype in memallocator
Added reconnect function for filtergraph

memallocator worked before, but deletemediatype was renamed to 
freemediatype, didn't want to make a seperate patch as it is one line..
-------------- next part --------------
? quartz.patch
Index: filtergraph.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/filtergraph.c,v
retrieving revision 1.29
diff -u -p -r1.29 filtergraph.c
--- filtergraph.c	6 May 2005 14:34:44 -0000	1.29
+++ filtergraph.c	18 May 2005 11:36:18 -0000
@@ -473,10 +473,27 @@ static HRESULT WINAPI Graphbuilder_Conne
 static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
 					     IPin *ppin) {
     ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
+    IPin *pConnectedTo = NULL;
+    HRESULT hr;
+    PIN_DIRECTION pindir;
 
-    TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppin);
-
-    return S_OK;
+    IPin_QueryDirection(ppin, &pindir);
+    hr = IPin_ConnectedTo(ppin, &pConnectedTo);
+    if (FAILED(hr)) {
+        TRACE("Querying connected to failed: %lx\n", hr);
+        return hr; 
+    }
+    IPin_Disconnect(ppin);
+    IPin_Disconnect(pConnectedTo);
+    if (pindir == PINDIR_INPUT)
+        hr = IPin_Connect(pConnectedTo, ppin, NULL);
+    else
+        hr = IPin_Connect(ppin, pConnectedTo, NULL);
+    IPin_Release(pConnectedTo);
+    if (FAILED(hr))
+        ERR("Reconnecting pins failed, pins are not connected now..\n");
+    TRACE("(%p->%p) -- %p %p -> %lx\n", iface, This, ppin, pConnectedTo, hr);
+    return hr;
 }
 
 static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,
Index: memallocator.c
===================================================================
RCS file: /home/wine/wine/dlls/quartz/memallocator.c,v
retrieving revision 1.8
diff -u -p -r1.8 memallocator.c
--- memallocator.c	11 Apr 2005 18:50:58 -0000	1.8
+++ memallocator.c	18 May 2005 11:36:18 -0000
@@ -659,7 +659,7 @@ static HRESULT WINAPI StdMediaSample2_Se
     TRACE("(%p)\n", pMediaType);
 
     if (This->props.pMediaType)
-        DeleteMediaType(This->props.pMediaType);
+        FreeMediaType(This->props.pMediaType);
     else if (!(This->props.pMediaType = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))))
         return E_OUTOFMEMORY;
 


More information about the wine-patches mailing list