From dc6e0a6cb51a6216ead828947fb94d35fdfa353b Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 28 Feb 2019 19:00:26 -0600 Subject: [PATCH] quartz/mpegsplit: Fix sink pin name. This fixes a bug with Neocron 2, which uses FindPin() to retrieve the sink pin. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/quartz/avisplit.c | 7 ++++++- dlls/quartz/mpegsplit.c | 6 +++++- dlls/quartz/parser.c | 10 +++++++--- dlls/quartz/parser.h | 7 +++++-- dlls/quartz/waveparser.c | 6 +++++- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c index 6f27c293214..40020bbfa9f 100644 --- a/dlls/quartz/avisplit.c +++ b/dlls/quartz/avisplit.c @@ -1429,6 +1429,7 @@ static const IBaseFilterVtbl AVISplitterImpl_Vtbl = HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) { + static const WCHAR sink_name[] = {'i','n','p','u','t',' ','p','i','n',0}; HRESULT hr; AVISplitterImpl * This; @@ -1445,7 +1446,11 @@ HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) This->streams = NULL; This->oldindex = NULL; - hr = Parser_Create(&(This->Parser), &AVISplitterImpl_Vtbl, &CLSID_AviSplitter, AVISplitter_Sample, AVISplitter_QueryAccept, AVISplitter_InputPin_PreConnect, AVISplitter_Flush, AVISplitter_Disconnect, AVISplitter_first_request, AVISplitter_done_process, NULL, AVISplitter_seek, NULL); + hr = Parser_Create(&This->Parser, &AVISplitterImpl_Vtbl, &CLSID_AviSplitter, + sink_name, AVISplitter_Sample, AVISplitter_QueryAccept, + AVISplitter_InputPin_PreConnect, AVISplitter_Flush, + AVISplitter_Disconnect, AVISplitter_first_request, + AVISplitter_done_process, NULL, AVISplitter_seek, NULL); if (FAILED(hr)) return hr; diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 5869f1664cd..226fcacff50 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -870,6 +870,7 @@ static const IAMStreamSelectVtbl AMStreamSelectVtbl = HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) { + static const WCHAR sink_name[] = {'I','n','p','u','t',0}; MPEGSplitterImpl *This; HRESULT hr = E_FAIL; @@ -885,7 +886,10 @@ HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) return E_OUTOFMEMORY; ZeroMemory(This, sizeof(MPEGSplitterImpl)); - hr = Parser_Create(&(This->Parser), &MPEGSplitter_Vtbl, &CLSID_MPEG1Splitter, MPEGSplitter_process_sample, MPEGSplitter_query_accept, MPEGSplitter_pre_connect, MPEGSplitter_cleanup, MPEGSplitter_disconnect, MPEGSplitter_first_request, NULL, NULL, MPEGSplitter_seek, NULL); + hr = Parser_Create(&This->Parser, &MPEGSplitter_Vtbl, &CLSID_MPEG1Splitter, + sink_name, MPEGSplitter_process_sample, MPEGSplitter_query_accept, + MPEGSplitter_pre_connect, MPEGSplitter_cleanup, MPEGSplitter_disconnect, + MPEGSplitter_first_request, NULL, NULL, MPEGSplitter_seek, NULL); if (FAILED(hr)) { CoTaskMemFree(This); diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 664cecf07d3..b0cb500c56d 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -35,7 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); -static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0}; static const IMediaSeekingVtbl Parser_Seeking_Vtbl; static const IPinVtbl Parser_OutputPin_Vtbl; static const IPinVtbl Parser_InputPin_Vtbl; @@ -93,7 +92,12 @@ static const BaseFilterFuncTable BaseFuncTable = { Parser_GetPinCount }; -HRESULT Parser_Create(ParserImpl* pParser, const IBaseFilterVtbl *Parser_Vtbl, const CLSID* pClsid, PFN_PROCESS_SAMPLE fnProcessSample, PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect, PFN_CLEANUP fnCleanup, PFN_DISCONNECT fnDisconnect, REQUESTPROC fnRequest, STOPPROCESSPROC fnDone, SourceSeeking_ChangeStop stop, SourceSeeking_ChangeStart start, SourceSeeking_ChangeRate rate) +HRESULT Parser_Create(ParserImpl *pParser, const IBaseFilterVtbl *Parser_Vtbl, + const CLSID* pClsid, const WCHAR *sink_name, PFN_PROCESS_SAMPLE fnProcessSample, + PFN_QUERY_ACCEPT fnQueryAccept, PFN_PRE_CONNECT fnPreConnect, + PFN_CLEANUP fnCleanup, PFN_DISCONNECT fnDisconnect, REQUESTPROC fnRequest, + STOPPROCESSPROC fnDone, SourceSeeking_ChangeStop stop, + SourceSeeking_ChangeStart start, SourceSeeking_ChangeRate rate) { HRESULT hr; PIN_INFO piInput; @@ -109,7 +113,7 @@ HRESULT Parser_Create(ParserImpl* pParser, const IBaseFilterVtbl *Parser_Vtbl, c /* construct input pin */ piInput.dir = PINDIR_INPUT; piInput.pFilter = &pParser->filter.IBaseFilter_iface; - lstrcpynW(piInput.achName, wcsInputPinName, ARRAY_SIZE(piInput.achName)); + lstrcpynW(piInput.achName, sink_name, ARRAY_SIZE(piInput.achName)); if (!start) start = Parser_ChangeStart; diff --git a/dlls/quartz/parser.h b/dlls/quartz/parser.h index 840e475ee27..8660cf2cde5 100644 --- a/dlls/quartz/parser.h +++ b/dlls/quartz/parser.h @@ -53,8 +53,11 @@ typedef struct Parser_OutputPin extern HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, const AM_MEDIA_TYPE * amt); -extern HRESULT Parser_Create(ParserImpl*, const IBaseFilterVtbl *, const CLSID*, PFN_PROCESS_SAMPLE, PFN_QUERY_ACCEPT, PFN_PRE_CONNECT, - PFN_CLEANUP, PFN_DISCONNECT, REQUESTPROC, STOPPROCESSPROC, SourceSeeking_ChangeStop stop, SourceSeeking_ChangeStart start, SourceSeeking_ChangeRate rate); +HRESULT Parser_Create(ParserImpl *parser, const IBaseFilterVtbl *vtbl, + const CLSID *clsid, const WCHAR *sink_name, PFN_PROCESS_SAMPLE, + PFN_QUERY_ACCEPT, PFN_PRE_CONNECT, PFN_CLEANUP, PFN_DISCONNECT, + REQUESTPROC, STOPPROCESSPROC, SourceSeeking_ChangeStop, + SourceSeeking_ChangeStart, SourceSeeking_ChangeRate) DECLSPEC_HIDDEN; /* Override the _Release function and call this when releasing */ extern void Parser_Destroy(ParserImpl *This); diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c index fa9cd45d276..834b6344d25 100644 --- a/dlls/quartz/waveparser.c +++ b/dlls/quartz/waveparser.c @@ -417,6 +417,7 @@ static const IBaseFilterVtbl WAVEParser_Vtbl = HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv) { + static const WCHAR sink_name[] = {'i','n','p','u','t',' ','p','i','n',0}; HRESULT hr; WAVEParserImpl * This; @@ -430,7 +431,10 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv) /* Note: This memory is managed by the transform filter once created */ This = CoTaskMemAlloc(sizeof(WAVEParserImpl)); - hr = Parser_Create(&(This->Parser), &WAVEParser_Vtbl, &CLSID_WAVEParser, WAVEParser_Sample, WAVEParser_QueryAccept, WAVEParser_InputPin_PreConnect, WAVEParser_Cleanup, WAVEParser_disconnect, WAVEParser_first_request, NULL, NULL, WAVEParserImpl_seek, NULL); + hr = Parser_Create(&This->Parser, &WAVEParser_Vtbl, &CLSID_WAVEParser, + sink_name, WAVEParser_Sample, WAVEParser_QueryAccept, + WAVEParser_InputPin_PreConnect, WAVEParser_Cleanup, WAVEParser_disconnect, + WAVEParser_first_request, NULL, NULL, WAVEParserImpl_seek, NULL); if (FAILED(hr)) return hr;