amstream: Add source filter to the filtergraph before loading the file.

This commit is contained in:
Christian Costa 2012-03-12 19:54:56 +01:00 committed by Alexandre Julliard
parent b15c4113c0
commit 14e228c699
1 changed files with 6 additions and 7 deletions

View File

@ -316,6 +316,10 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
if(ret != S_OK)
return ret;
ret = IGraphBuilder_AddSourceFilter(This->pFilterGraph, pszFileName, pszFileName, &BaseFilter);
if (FAILED(ret))
goto end;
ret = IFileSourceFilter_Load(SourceFilter, pszFileName, NULL);
if(ret != S_OK)
{
@ -337,23 +341,18 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac
}
ret = IEnumPins_Next(EnumPins, 1, &ipin, NULL);
if(ret == S_OK)
if (ret == S_OK)
{
ret = IPin_QueryDirection(ipin, &pin_direction);
IEnumPins_Release(EnumPins);
if(ret == S_OK && pin_direction == PINDIR_OUTPUT)
if (ret == S_OK && pin_direction == PINDIR_OUTPUT)
This->ipin = ipin;
else
goto end;
}
else
{
IEnumPins_Release(EnumPins);
goto end;
}
ret = IGraphBuilder_AddSourceFilter(This->pFilterGraph, pszFileName, pszFileName, &BaseFilter);
end:
IBaseFilter_Release(BaseFilter);
IFileSourceFilter_Release(SourceFilter);