Zebediah Figura : strmbase/transform: Get rid of superfluous npins field.

Alexandre Julliard julliard at winehq.org
Wed Mar 6 15:29:39 CST 2019


Module: wine
Branch: master
Commit: 1cabe7e4a399b764754c5a733bc5df8254c7bd0e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1cabe7e4a399b764754c5a733bc5df8254c7bd0e

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Mar  5 23:28:37 2019 -0600

strmbase/transform: Get rid of superfluous npins field.

Also return the correct number of pins in TransformFilter_GetPinCount().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/avidec.c |  2 --
 dlls/strmbase/transform.c  | 17 +++++++----------
 include/wine/strmbase.h    |  1 -
 3 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c
index 5b85804..39882db 100644
--- a/dlls/quartz/tests/avidec.c
+++ b/dlls/quartz/tests/avidec.c
@@ -182,11 +182,9 @@ todo_wine
     ok(hr == S_OK, "Got hr %#x.\n", hr);
 
     hr = IEnumPins_Skip(enum1, 3);
-todo_wine
     ok(hr == S_FALSE, "Got hr %#x.\n", hr);
 
     hr = IEnumPins_Skip(enum1, 2);
-todo_wine
     ok(hr == S_OK, "Got hr %#x.\n", hr);
 
     hr = IEnumPins_Skip(enum1, 1);
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index 2fdd2ba..58533bd 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -144,22 +144,20 @@ static HRESULT WINAPI TransformFilter_Output_GetMediaType(BasePin *This, int iPo
     return S_OK;
 }
 
-static IPin* WINAPI TransformFilter_GetPin(BaseFilter *iface, int pos)
+static IPin *WINAPI TransformFilter_GetPin(BaseFilter *iface, int index)
 {
-    TransformFilter *This = impl_from_BaseFilter(iface);
+    TransformFilter *filter = impl_from_BaseFilter(iface);
 
-    if (pos >= This->npins || pos < 0)
+    if (index >= 2 || index < 0)
         return NULL;
 
-    IPin_AddRef(This->ppPins[pos]);
-    return This->ppPins[pos];
+    IPin_AddRef(filter->ppPins[index]);
+    return filter->ppPins[index];
 }
 
 static LONG WINAPI TransformFilter_GetPinCount(BaseFilter *iface)
 {
-    TransformFilter *This = impl_from_BaseFilter(iface);
-
-    return (This->npins+1);
+    return 2;
 }
 
 static const BaseFilterFuncTable tfBaseFuncTable = {
@@ -203,7 +201,6 @@ static HRESULT TransformFilter_Init(const IBaseFilterVtbl *pVtbl, const CLSID* p
     /* pTransformFilter is already allocated */
     pTransformFilter->pFuncsTable = pFuncsTable;
     ZeroMemory(&pTransformFilter->pmt, sizeof(pTransformFilter->pmt));
-    pTransformFilter->npins = 2;
 
     pTransformFilter->ppPins = CoTaskMemAlloc(2 * sizeof(IPin *));
 
@@ -314,7 +311,7 @@ ULONG WINAPI TransformFilterImpl_Release(IBaseFilter * iface)
     {
         ULONG i;
 
-        for (i = 0; i < This->npins; i++)
+        for (i = 0; i < 2; i++)
         {
             IPin *pConnectedTo;
 
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index 83a9084..a3890ae 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -212,7 +212,6 @@ typedef struct TransformFilter
 	BaseFilter filter;
 
 	IPin **ppPins;
-	ULONG npins;
 	AM_MEDIA_TYPE pmt;
 	CRITICAL_SECTION csReceive;
 




More information about the wine-cvs mailing list