From aa9aa7390f5d689f4ca39cbec98b9c0dd7f2e1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 25 Mar 2022 09:42:03 +0100 Subject: [PATCH] strmbase: Add a separate id for pins. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RĂ©mi Bernon Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- include/wine/strmbase.h | 1 + libs/strmbase/filter.c | 2 +- libs/strmbase/pin.c | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 3e92136b7f7..1b4cc3f7657 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -36,6 +36,7 @@ struct strmbase_pin struct strmbase_filter *filter; PIN_DIRECTION dir; WCHAR name[128]; + WCHAR id[128]; IPin *peer; AM_MEDIA_TYPE mt; diff --git a/libs/strmbase/filter.c b/libs/strmbase/filter.c index 92b4f1cb4b6..ee41611a198 100644 --- a/libs/strmbase/filter.c +++ b/libs/strmbase/filter.c @@ -436,7 +436,7 @@ static HRESULT WINAPI filter_FindPin(IBaseFilter *iface, const WCHAR *id, IPin * for (i = 0; (pin = filter->ops->filter_get_pin(filter, i)); ++i) { - if (!lstrcmpW(id, pin->name)) + if (!lstrcmpW(id, pin->id)) { IPin_AddRef(*ret = &pin->IPin_iface); return S_OK; diff --git a/libs/strmbase/pin.c b/libs/strmbase/pin.c index 1aecb7a8c98..03330837477 100644 --- a/libs/strmbase/pin.c +++ b/libs/strmbase/pin.c @@ -383,10 +383,10 @@ static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id) TRACE("pin %p %s:%s, id %p.\n", pin, debugstr_w(pin->filter->name), debugstr_w(pin->name), id); - if (!(*id = CoTaskMemAlloc((lstrlenW(pin->name) + 1) * sizeof(WCHAR)))) + if (!(*id = CoTaskMemAlloc((lstrlenW(pin->id) + 1) * sizeof(WCHAR)))) return E_OUTOFMEMORY; - lstrcpyW(*id, pin->name); + lstrcpyW(*id, pin->id); return S_OK; } @@ -770,6 +770,7 @@ void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *f pin->pin.filter = filter; pin->pin.dir = PINDIR_OUTPUT; lstrcpyW(pin->pin.name, name); + lstrcpyW(pin->pin.id, name); pin->pin.ops = &func_table->base; pin->pFuncsTable = func_table; } @@ -1172,6 +1173,7 @@ void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filte pin->pin.filter = filter; pin->pin.dir = PINDIR_INPUT; lstrcpyW(pin->pin.name, name); + lstrcpyW(pin->pin.id, name); pin->pin.ops = &func_table->base; pin->pFuncsTable = func_table; pin->pAllocator = pin->preferred_allocator = allocator;