On 4/21/20 7:19 AM, Gabriel Ivăncescu wrote:
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
The IFileSourceFilter is not queried for filters placed via put_Filter, so obtain the media type from the first pin to use for finding a matching splitter.
The async reader (at least) exposes the same (first) media type from the source as through IFileSourceFilter::GetCurFile(), so it seems to me we could simplify by using this path for all filters.
dlls/qedit/mediadet.c | 45 +++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-)
diff --git a/dlls/qedit/mediadet.c b/dlls/qedit/mediadet.c index d1e8b71..0a9210c 100644 --- a/dlls/qedit/mediadet.c +++ b/dlls/qedit/mediadet.c @@ -150,22 +150,43 @@ static HRESULT get_splitter(MediaDetImpl *This) if (FAILED(hr)) return hr;
- hr = IBaseFilter_QueryInterface(This->source, &IID_IFileSourceFilter,
(void **) &file);
- if (FAILED(hr))
- if (This->filename) {
IFilterMapper2_Release(map);
return hr;
- }
hr = IBaseFilter_QueryInterface(This->source, &IID_IFileSourceFilter,
(void **) &file);
if (FAILED(hr))
{
IFilterMapper2_Release(map);
return hr;
}
- hr = IFileSourceFilter_GetCurFile(file, &name, &mt);
- IFileSourceFilter_Release(file);
- CoTaskMemFree(name);
- if (FAILED(hr))
hr = IFileSourceFilter_GetCurFile(file, &name, &mt);
IFileSourceFilter_Release(file);
CoTaskMemFree(name);
if (FAILED(hr))
{
IFilterMapper2_Release(map);
return hr;
}
- }
- else {
IFilterMapper2_Release(map);
return hr;
mt.majortype = GUID_NULL;
mt.subtype = GUID_NULL;
mt.pbFormat = NULL;
hr = IBaseFilter_EnumPins(This->source, &pins);
if (SUCCEEDED(hr))
{
if (IEnumPins_Next(pins, 1, &source_pin, NULL) == S_OK)
{
get_pin_media_type(source_pin, &mt);
IPin_Release(source_pin);
}
IEnumPins_Release(pins);
}}
- type[0] = mt.majortype; type[1] = mt.subtype; CoTaskMemFree(mt.pbFormat);