quartz: Simplify all_renderers_seek.
Since IAMFilterMiscFlags is supported by all source/renderer filters, use that instead.
This commit is contained in:
parent
7fda01e522
commit
14229c1176
|
@ -2136,53 +2136,34 @@ typedef HRESULT (WINAPI *fnFoundSeek)(IFilterGraphImpl *This, IMediaSeeking*, DW
|
||||||
static HRESULT all_renderers_seek(IFilterGraphImpl *This, fnFoundSeek FoundSeek, DWORD_PTR arg) {
|
static HRESULT all_renderers_seek(IFilterGraphImpl *This, fnFoundSeek FoundSeek, DWORD_PTR arg) {
|
||||||
BOOL allnotimpl = TRUE;
|
BOOL allnotimpl = TRUE;
|
||||||
int i;
|
int i;
|
||||||
IBaseFilter* pfilter;
|
|
||||||
IEnumPins* pEnum;
|
|
||||||
HRESULT hr, hr_return = S_OK;
|
HRESULT hr, hr_return = S_OK;
|
||||||
IPin* pPin;
|
|
||||||
DWORD dummy;
|
|
||||||
PIN_DIRECTION dir;
|
|
||||||
|
|
||||||
TRACE("(%p)->(%p %08lx)\n", This, FoundSeek, arg);
|
TRACE("(%p)->(%p %08lx)\n", This, FoundSeek, arg);
|
||||||
/* Send a message to all renderers, they are responsible for broadcasting it further */
|
/* Send a message to all renderers, they are responsible for broadcasting it further */
|
||||||
|
|
||||||
for(i = 0; i < This->nFilters; i++)
|
for(i = 0; i < This->nFilters; i++)
|
||||||
{
|
{
|
||||||
BOOL renderer = TRUE;
|
IMediaSeeking *seek = NULL;
|
||||||
pfilter = This->ppFiltersInGraph[i];
|
IBaseFilter* pfilter = This->ppFiltersInGraph[i];
|
||||||
hr = IBaseFilter_EnumPins(pfilter, &pEnum);
|
IAMFilterMiscFlags *flags = NULL;
|
||||||
if (hr != S_OK)
|
ULONG filterflags;
|
||||||
{
|
IUnknown_QueryInterface(pfilter, &IID_IAMFilterMiscFlags, (void**)&flags);
|
||||||
WARN("Enum pins failed %x\n", hr);
|
if (!flags)
|
||||||
|
continue;
|
||||||
|
filterflags = IAMFilterMiscFlags_GetMiscFlags(flags);
|
||||||
|
IUnknown_Release(flags);
|
||||||
|
if (filterflags != AM_FILTER_MISC_FLAGS_IS_RENDERER)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
/* Check if it is a source filter */
|
|
||||||
while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
|
|
||||||
{
|
|
||||||
IPin_QueryDirection(pPin, &dir);
|
|
||||||
IPin_Release(pPin);
|
|
||||||
if (dir != PINDIR_INPUT)
|
|
||||||
{
|
|
||||||
renderer = FALSE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IEnumPins_Release(pEnum);
|
|
||||||
if (renderer)
|
|
||||||
{
|
|
||||||
IMediaSeeking *seek = NULL;
|
|
||||||
IBaseFilter_QueryInterface(pfilter, &IID_IMediaSeeking, (void**)&seek);
|
|
||||||
if (!seek)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
hr = FoundSeek(This, seek, arg);
|
IBaseFilter_QueryInterface(pfilter, &IID_IMediaSeeking, (void**)&seek);
|
||||||
|
if (!seek)
|
||||||
IMediaSeeking_Release(seek);
|
continue;
|
||||||
if (hr_return != E_NOTIMPL)
|
hr = FoundSeek(This, seek, arg);
|
||||||
allnotimpl = FALSE;
|
IMediaSeeking_Release(seek);
|
||||||
if (hr_return == S_OK || (FAILED(hr) && hr != E_NOTIMPL && SUCCEEDED(hr_return)))
|
if (hr_return != E_NOTIMPL)
|
||||||
hr_return = hr;
|
allnotimpl = FALSE;
|
||||||
}
|
if (hr_return == S_OK || (FAILED(hr) && hr != E_NOTIMPL && SUCCEEDED(hr_return)))
|
||||||
|
hr_return = hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allnotimpl)
|
if (allnotimpl)
|
||||||
|
|
Loading…
Reference in New Issue