amstream: Initialize MultiMediastream before creating the source filter.

This commit is contained in:
Christian Costa 2012-03-12 19:54:39 +01:00 committed by Alexandre Julliard
parent 21e5c4c417
commit 8b5f6bf3f4
1 changed files with 12 additions and 14 deletions

View File

@ -305,6 +305,18 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
TRACE("(%p/%p)->(%s,%x)\n", This, iface, debugstr_w(pszFileName), dwFlags); 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); ret = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IFileSourceFilter, (void**)&SourceFilter);
if(ret != S_OK) if(ret != S_OK)
return ret; return ret;
@ -345,20 +357,6 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
goto end; 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); ret = IGraphBuilder_AddSourceFilter(This->GraphBuilder, pszFileName, pszFileName, &BaseFilter);
end: end: