mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 11:50:17 +00:00
qedit: Use the pin's media type instead of querying for IFileSourceFilter.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ef00425a9c
commit
11fd209205
|
@ -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)))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue