Commit 028ad9b8 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz: Simplify error handling in GetClassMediaFile().

parent 66d40aab
......@@ -1691,11 +1691,10 @@ static HRESULT GetFileSourceFilter(LPCOLESTR pszFileName, IBaseFilter **filter)
IFileSourceFilter* pSource = NULL;
IPin * pOutputPin = NULL;
static const WCHAR wszOutputPinName[] = { 'O','u','t','p','u','t',0 };
BOOL ret;
/* Try to find a match without reading the file first */
hr = GetClassMediaFile(NULL, pszFileName, NULL, NULL, &clsid);
if (hr == S_OK)
if (get_media_type(NULL, pszFileName, NULL, NULL, &clsid))
return CreateFilterInstanceAndLoadFile(&clsid, pszFileName, filter);
/* Now create a AyncReader instance, to check for signature bytes in the file */
......@@ -1734,10 +1733,10 @@ static HRESULT GetFileSourceFilter(LPCOLESTR pszFileName, IBaseFilter **filter)
}
/* Try again find a match */
hr = GetClassMediaFile(pReader, pszFileName, NULL, NULL, &clsid);
ret = get_media_type(pReader, pszFileName, NULL, NULL, &clsid);
IAsyncReader_Release(pReader);
if (hr == S_OK)
if (ret)
{
TRACE("Found source filter %s.\n", debugstr_guid(&clsid));
/* Release the AsyncReader filter and create the matching one */
......
......@@ -77,6 +77,6 @@ extern void video_unregister_windowclass(void) DECLSPEC_HIDDEN;
BOOL CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE * pmt2, BOOL bWildcards);
void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE * pmt) DECLSPEC_HIDDEN;
HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID * majorType, GUID * minorType, GUID * sourceFilter);
BOOL get_media_type(IAsyncReader *reader, const WCHAR *filename, GUID *majortype, GUID *subtype, GUID *source_clsid) DECLSPEC_HIDDEN;
#endif /* __QUARTZ_PRIVATE_INCLUDED__ */
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