Commit 11fd2092 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

qedit: Use the pin's media type instead of querying for IFileSourceFilter.

parent ef00425a
......@@ -124,12 +124,10 @@ static HRESULT get_pin_media_type(IPin *pin, AM_MEDIA_TYPE *out)
static HRESULT find_splitter(MediaDetImpl *detector)
{
IPin *source_pin, *splitter_pin;
IFileSourceFilter *file_source;
IEnumMoniker *enum_moniker;
IFilterMapper2 *mapper;
IBaseFilter *splitter;
IEnumPins *enum_pins;
LPOLESTR filename;
AM_MEDIA_TYPE mt;
IMoniker *mon;
GUID type[2];
......@@ -137,25 +135,6 @@ static HRESULT find_splitter(MediaDetImpl *detector)
HRESULT hr;
GUID clsid;
if (FAILED(hr = IBaseFilter_QueryInterface(detector->source,
&IID_IFileSourceFilter, (void **)&file_source)))
{
ERR("Failed to get file source interface.\n");
return hr;
}
hr = IFileSourceFilter_GetCurFile(file_source, &filename, &mt);
IFileSourceFilter_Release(file_source);
CoTaskMemFree(filename);
if (FAILED(hr))
{
ERR("Failed to get current file, hr %#x.\n", hr);
return hr;
}
type[0] = mt.majortype;
type[1] = mt.subtype;
FreeMediaType(&mt);
if (FAILED(hr = IBaseFilter_EnumPins(detector->source, &enum_pins)))
{
ERR("Failed to enumerate source pins, hr %#x.\n", hr);
......@@ -169,6 +148,17 @@ static HRESULT find_splitter(MediaDetImpl *detector)
return hr;
}
if (FAILED(hr = get_pin_media_type(source_pin, &mt)))
{
ERR("Failed to get media type, hr %#x.\n", hr);
IPin_Release(source_pin);
return hr;
}
type[0] = mt.majortype;
type[1] = mt.subtype;
FreeMediaType(&mt);
if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL,
CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (void **)&mapper)))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment