[PATCH 1/4] amstream: Initialize MultiMediastream before creating the source filter.

Christian Costa titan.costa at gmail.com
Mon Mar 12 13:54:39 CDT 2012


---
 dlls/amstream/amstream.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/dlls/amstream/amstream.c b/dlls/amstream/amstream.c
index bebe6e8..72ace4a 100644
--- a/dlls/amstream/amstream.c
+++ b/dlls/amstream/amstream.c
@@ -305,6 +305,18 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
 
     TRACE("(%p/%p)->(%s,%x)\n", This, iface, debugstr_w(pszFileName), dwFlags);
 
+    /* If Initialize was not called before, we do it here */
+    if (!This->pFilterGraph)
+    {
+        ret = IAMMultiMediaStream_Initialize(iface, STREAMTYPE_READ, 0, NULL);
+        if (FAILED(ret))
+            return ret;
+    }
+
+    ret = IFilterGraph_QueryInterface(This->pFilterGraph, &IID_IGraphBuilder, (void**)&This->GraphBuilder);
+    if (ret != S_OK)
+        goto end;
+
     ret = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IFileSourceFilter, (void**)&SourceFilter);
     if(ret != S_OK)
         return ret;
@@ -345,20 +357,6 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
         goto end;
     }
 
-    /* If Initialize was not called before, we do it here */
-    if (!This->pFilterGraph)
-    {
-        ret = IAMMultiMediaStream_Initialize(iface, STREAMTYPE_READ, 0, NULL);
-        if (FAILED(ret))
-            goto end;
-    }
-
-    ret = IFilterGraph_QueryInterface(This->pFilterGraph, &IID_IGraphBuilder, (void**)&This->GraphBuilder);
-    if(ret != S_OK)
-    {
-        goto end;
-    }
-
     ret = IGraphBuilder_AddSourceFilter(This->GraphBuilder, pszFileName, pszFileName, &BaseFilter);
 
 end:




More information about the wine-patches mailing list