Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
The IFileSourceFilter is not queried for filters placed via put_Filter (as shown by tests later), so obtain the media type from the first pin to use for finding a matching splitter.
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 fc1b62e..b9adb89 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);