Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/evr/evr.c | 4 ++-- dlls/qcap/audiorecord.c | 5 ++--- dlls/qcap/avico.c | 15 ++++----------- dlls/qcap/avimux.c | 15 ++++++++------- dlls/qcap/smartteefilter.c | 18 +++++------------- dlls/qcap/vfwcapture.c | 4 ++-- dlls/qedit/samplegrabber.c | 6 +++--- dlls/quartz/filesource.c | 6 ++---- dlls/quartz/parser.c | 14 +++++--------- dlls/strmbase/filter.c | 2 +- dlls/strmbase/renderer.c | 4 ++-- dlls/strmbase/transform.c | 4 ++-- dlls/winegstreamer/gstdemux.c | 10 ++++------ dlls/wineqtdecoder/qtsplitter.c | 2 +- include/wine/strmbase.h | 2 +- 15 files changed, 44 insertions(+), 67 deletions(-)
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index 01e4ee4598..493696f465 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -191,9 +191,9 @@ static const IBaseFilterVtbl basefilter_vtbl = BaseFilterImpl_QueryVendorInfo };
-static IPin* WINAPI filter_GetPin(BaseFilter *iface, int position) +static IPin * WINAPI filter_GetPin(BaseFilter *iface, unsigned int index) { - FIXME("(%p, %d): stub!\n", iface, position); + FIXME("iface %p, index %u, stub!\n", iface, index); return NULL; }
diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index 373bc9a025..1e5aa43cfb 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -171,10 +171,9 @@ static const IBaseFilterVtbl AudioRecordVtbl = { BaseFilterImpl_QueryVendorInfo };
-static IPin* WINAPI AudioRecord_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI AudioRecord_GetPin(BaseFilter *iface, unsigned int index) { - AudioRecord *This = impl_from_BaseFilter(iface); - FIXME("(%p, %d): stub\n", This, pos); + FIXME("iface %p, index %u, stub!\n", iface, index); return NULL; }
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 5ea4016a65..770790da1c 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -244,24 +244,17 @@ static const IBaseFilterVtbl AVICompressorVtbl = { AVICompressor_QueryVendorInfo };
-static IPin* WINAPI AVICompressor_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI AVICompressor_GetPin(BaseFilter *iface, unsigned int index) { AVICompressor *This = impl_from_BaseFilter(iface); IPin *ret;
- TRACE("(%p)->(%d)\n", This, pos); - - switch(pos) { - case 0: + if (index == 0) ret = &This->in->pin.IPin_iface; - break; - case 1: + else if (index == 1) ret = &This->out->pin.IPin_iface; - break; - default: - TRACE("No pin %d\n", pos); + else return NULL; - };
IPin_AddRef(ret); return ret; diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index ff45fb0112..ccec60c0b5 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -116,18 +116,19 @@ static inline AviMux* impl_from_BaseFilter(BaseFilter *filter) return CONTAINING_RECORD(filter, AviMux, filter); }
-static IPin* WINAPI AviMux_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI AviMux_GetPin(BaseFilter *iface, unsigned int index) { AviMux *This = impl_from_BaseFilter(iface);
- TRACE("(%p)->(%d)\n", This, pos); - - if(pos == 0) { + if (!index) + { IPin_AddRef(&This->out->pin.pin.IPin_iface); return &This->out->pin.pin.IPin_iface; - }else if(pos>0 && pos<=This->input_pin_no) { - IPin_AddRef(&This->in[pos-1]->pin.pin.IPin_iface); - return &This->in[pos-1]->pin.pin.IPin_iface; + } + else if (index <= This->input_pin_no) + { + IPin_AddRef(&This->in[index - 1]->pin.pin.IPin_iface); + return &This->in[index - 1]->pin.pin.IPin_iface; }
return NULL; diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index cbcbc455ed..e16d08a759 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -199,27 +199,19 @@ static const IBaseFilterVtbl SmartTeeFilterVtbl = { BaseFilterImpl_QueryVendorInfo };
-static IPin* WINAPI SmartTeeFilter_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI SmartTeeFilter_GetPin(BaseFilter *iface, unsigned int index) { SmartTeeFilter *This = impl_from_BaseFilter(iface); IPin *ret;
- TRACE("(%p)->(%d)\n", This, pos); - - switch(pos) { - case 0: + if (index == 0) ret = &This->input->pin.IPin_iface; - break; - case 1: + else if (index == 1) ret = &This->capture->pin.IPin_iface; - break; - case 2: + else if (index == 2) ret = &This->preview->pin.IPin_iface; - break; - default: - TRACE("No pin %d\n", pos); + else return NULL; - }
IPin_AddRef(ret); return ret; diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index feb9c08e85..54d9e59786 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -192,11 +192,11 @@ static const IUnknownVtbl unknown_inner_vtbl = unknown_inner_Release, };
-static IPin* WINAPI VfwCapture_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI VfwCapture_GetPin(BaseFilter *iface, unsigned int index) { VfwCapture *This = impl_from_BaseFilter(iface);
- if (pos >= 1 || pos < 0) + if (index >= 1) return NULL;
IPin_AddRef(This->pOutputPin); diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index bc91f72af1..cbaca69962 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -339,14 +339,14 @@ static const IUnknownVtbl samplegrabber_vtbl = SampleGrabber_Release, };
-static IPin *WINAPI SampleGrabber_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI SampleGrabber_GetPin(BaseFilter *iface, unsigned int index) { SG_Impl *This = impl_from_BaseFilter(iface); IPin *pin;
- if (pos == 0) + if (index == 0) pin = &This->pin_in.IPin_iface; - else if (pos == 1) + else if (index == 1) pin = &This->pin_out.IPin_iface; else return NULL; diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index a331d3359a..f3a2c43c63 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -392,13 +392,11 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID * return hr; }
-static IPin* WINAPI AsyncReader_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI AsyncReader_GetPin(BaseFilter *iface, unsigned int index) { AsyncReader *This = impl_from_BaseFilter(iface);
- TRACE("%p->(%d)\n", This, pos); - - if (pos >= 1 || !This->pOutputPin) + if (index >= 1 || !This->pOutputPin) return NULL;
IPin_AddRef(This->pOutputPin); diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 2af8a1ff6d..e21908504a 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -62,19 +62,15 @@ static inline ParserImpl *impl_from_BaseFilter( BaseFilter *iface ) return CONTAINING_RECORD(iface, ParserImpl, filter); }
-/* FIXME: WRONG */ -static IPin* WINAPI Parser_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI Parser_GetPin(BaseFilter *iface, unsigned int index) { - ParserImpl *This = impl_from_BaseFilter(iface); + ParserImpl *filter = impl_from_BaseFilter(iface);
- TRACE("%p->(%x)\n", This, pos); - - /* Input pin also has a pin, hence the > and not >= */ - if (pos > This->cStreams || pos < 0) + if (index > filter->cStreams) return NULL;
- IPin_AddRef(This->ppPins[pos]); - return This->ppPins[pos]; + IPin_AddRef(filter->ppPins[index]); + return filter->ppPins[index]; }
static const BaseFilterFuncTable BaseFuncTable = { diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 8bec368c15..c554097814 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -137,10 +137,10 @@ HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret) { BaseFilter *This = impl_from_IBaseFilter(iface); + unsigned int i; PIN_INFO info; HRESULT hr; IPin *pin; - int i;
TRACE("(%p)->(%s, %p)\n", This, debugstr_w(id), ret);
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index c6c7978235..cf6643befe 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -183,11 +183,11 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl = BaseInputPinImpl_NewSegment };
-static IPin* WINAPI BaseRenderer_GetPin(BaseFilter *iface, int pos) +static IPin * WINAPI BaseRenderer_GetPin(BaseFilter *iface, unsigned int index) { BaseRenderer *This = impl_from_BaseFilter(iface);
- if (pos >= 1 || pos < 0) + if (index >= 1) return NULL;
IPin_AddRef(&This->pInputPin->pin.IPin_iface); diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index b8eb60ce2e..8f156ae3de 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -128,11 +128,11 @@ static HRESULT WINAPI TransformFilter_Output_GetMediaType(BasePin *This, int iPo return S_OK; }
-static IPin *WINAPI TransformFilter_GetPin(BaseFilter *iface, int index) +static IPin *WINAPI TransformFilter_GetPin(BaseFilter *iface, unsigned int index) { TransformFilter *filter = impl_from_BaseFilter(iface);
- if (index >= 2 || index < 0) + if (index >= 2) return NULL;
IPin_AddRef(filter->ppPins[index]); diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 3653f647c4..3e660216e8 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1192,20 +1192,18 @@ static inline GSTOutPin *impl_from_IMediaSeeking( IMediaSeeking *iface ) return CONTAINING_RECORD(iface, GSTOutPin, seek.IMediaSeeking_iface); }
-static IPin* WINAPI GST_GetPin(BaseFilter *base, int pos) +static IPin* WINAPI GST_GetPin(BaseFilter *base, unsigned int index) { GSTImpl *This = impl_from_IBaseFilter(&base->IBaseFilter_iface); IPin *pin;
- TRACE("%p: Asking for pos %x\n", This, pos); - - if (pos > This->cStreams || pos < 0) + if (index > This->cStreams) return NULL;
- if (!pos) + if (!index) pin = &This->pInputPin.pin.IPin_iface; else - pin = &This->ppPins[pos - 1]->pin.pin.IPin_iface; + pin = &This->ppPins[index - 1]->pin.pin.IPin_iface;
IPin_AddRef(pin); return pin; diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 651a4a8c6b..6fd4554056 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -202,7 +202,7 @@ static inline QTSplitter *impl_from_IBaseFilter( IBaseFilter *iface ) * Base Filter */
-static IPin * WINAPI QT_GetPin(BaseFilter *base, int index) +static IPin * WINAPI QT_GetPin(BaseFilter *base, unsigned int index) { QTSplitter *filter = impl_from_BaseFilter(base);
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 2f150e8c48..c10e6e2123 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -168,7 +168,7 @@ typedef struct BaseFilter const struct BaseFilterFuncTable* pFuncsTable; } BaseFilter;
-typedef IPin* (WINAPI *BaseFilter_GetPin)(BaseFilter* iface, int iPosition); +typedef IPin * (WINAPI *BaseFilter_GetPin)(BaseFilter *iface, unsigned int index);
typedef struct BaseFilterFuncTable { /* Required */