Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 4 ++-- dlls/qcap/avimux.c | 2 +- dlls/qcap/smartteefilter.c | 4 ++-- dlls/quartz/dsoundrender.c | 14 +++++++------- dlls/quartz/filesource.c | 4 ++-- dlls/quartz/tests/videorenderer.c | 4 ++-- dlls/quartz/tests/vmr7.c | 4 ++-- dlls/quartz/tests/vmr9.c | 4 ++-- dlls/quartz/videorenderer.c | 4 ++-- dlls/quartz/vmr9.c | 6 +++--- dlls/strmbase/pin.c | 20 ++++++++++---------- dlls/winegstreamer/gstdemux.c | 4 ++-- dlls/wineqtdecoder/qtsplitter.c | 4 ++-- include/wine/strmbase.h | 2 +- 14 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 95e51f6e63..8eae692dca 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -470,7 +470,7 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample * if((This->driver_flags & VIDCF_TEMPORAL) && !(This->driver_flags & VIDCF_FASTTEMPORALC)) FIXME("Unsupported temporal compression\n");
- src_videoinfo = (VIDEOINFOHEADER *)This->sink.pin.mtCurrent.pbFormat; + src_videoinfo = (VIDEOINFOHEADER *)This->sink.pin.mt.pbFormat; This->videoinfo->bmiHeader.biSizeImage = This->max_frame_size; res = ICCompress(This->hic, sync_point ? ICCOMPRESS_KEYFRAME : 0, &This->videoinfo->bmiHeader, buf, &src_videoinfo->bmiHeader, ptr, 0, &comp_flags, This->frame_cnt, 0, 0, NULL, NULL); @@ -539,7 +539,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPo amt->subtype = MEDIASUBTYPE_PCM; amt->bFixedSizeSamples = FALSE; amt->bTemporalCompression = (This->driver_flags & VIDCF_TEMPORAL) != 0; - amt->lSampleSize = This->sink.pin.mtCurrent.lSampleSize; + amt->lSampleSize = This->sink.pin.mt.lSampleSize; amt->formattype = FORMAT_VideoInfo; amt->pUnk = NULL; amt->cbFormat = This->videoinfo_size; diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 8f7fe13285..e8067dd61d 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1416,7 +1416,7 @@ static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample size = IMediaSample_GetActualDataLength(pSample); }
- if(!avimuxin->pin.pin.mtCurrent.bTemporalCompression) + if(!avimuxin->pin.pin.mt.bTemporalCompression) flags |= AM_SAMPLE_SPLICEPOINT;
hr = IMediaSample_GetTime(pSample, &start, &stop); diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index a4d0a435ef..d3acf47e7e 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -142,7 +142,7 @@ static HRESULT sink_get_media_type(struct strmbase_pin *base, EnterCriticalSection(&This->filter.csFilter); if (This->sink.pin.peer) { - CopyMediaType(amt, &This->sink.pin.mtCurrent); + CopyMediaType(amt, &This->sink.pin.mt); hr = S_OK; } else @@ -331,7 +331,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *iface, if (!filter->sink.pin.peer) hr = VFW_E_NOT_CONNECTED; else if (!index) - CopyMediaType(mt, &filter->sink.pin.mtCurrent); + CopyMediaType(mt, &filter->sink.pin.mt); else hr = VFW_S_NO_MORE_ITEMS;
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index ed257c373f..fca1a710de 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -92,14 +92,14 @@ static inline DSoundRenderImpl *impl_from_IAMDirectSound(IAMDirectSound *iface) }
static REFERENCE_TIME time_from_pos(DSoundRenderImpl *This, DWORD pos) { - WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat; + WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat; REFERENCE_TIME ret = 10000000; ret = ret * pos / wfx->nAvgBytesPerSec; return ret; }
static DWORD pos_from_time(DSoundRenderImpl *This, REFERENCE_TIME time) { - WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat; + WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat; REFERENCE_TIME ret = time; ret *= wfx->nAvgBytesPerSec; ret /= 10000000; @@ -108,7 +108,7 @@ static DWORD pos_from_time(DSoundRenderImpl *This, REFERENCE_TIME time) { }
static void DSoundRender_UpdatePositions(DSoundRenderImpl *This, DWORD *seqwritepos, DWORD *minwritepos) { - WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat; + WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat; BYTE *buf1, *buf2; DWORD size1, size2, playpos, writepos, old_writepos, old_playpos, adv; BOOL writepos_set = This->writepos < This->buf_size; @@ -146,7 +146,7 @@ static void DSoundRender_UpdatePositions(DSoundRenderImpl *This, DWORD *seqwrite
static HRESULT DSoundRender_GetWritePos(DSoundRenderImpl *This, DWORD *ret_writepos, REFERENCE_TIME write_at, DWORD *pfree, DWORD *skip) { - WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mtCurrent.pbFormat; + WAVEFORMATEX *wfx = (WAVEFORMATEX *)This->renderer.sink.pin.mt.pbFormat; DWORD writepos, min_writepos, playpos; REFERENCE_TIME max_lag = 50 * 10000; REFERENCE_TIME min_lag = 25 * 10000; @@ -314,7 +314,7 @@ static HRESULT WINAPI DSoundRender_PrepareReceive(struct strmbase_renderer *ifac
if (IMediaSample_GetMediaType(pSample, &amt) == S_OK) { - AM_MEDIA_TYPE *orig = &This->renderer.sink.pin.mtCurrent; + AM_MEDIA_TYPE *orig = &This->renderer.sink.pin.mt; WAVEFORMATEX *origfmt = (WAVEFORMATEX *)orig->pbFormat; WAVEFORMATEX *newfmt = (WAVEFORMATEX *)amt->pbFormat;
@@ -434,7 +434,7 @@ static void dsound_render_start_stream(struct strmbase_renderer *iface) static HRESULT WINAPI DSoundRender_CompleteConnect(struct strmbase_renderer *iface, IPin *pReceivePin) { DSoundRenderImpl *This = impl_from_strmbase_renderer(iface); - const AM_MEDIA_TYPE *pmt = &This->renderer.sink.pin.mtCurrent; + const AM_MEDIA_TYPE *pmt = &This->renderer.sink.pin.mt; HRESULT hr = S_OK; WAVEFORMATEX *format; DSBUFFERDESC buf_desc; @@ -937,7 +937,7 @@ static HRESULT WINAPI ReferenceClock_GetTime(IReferenceClock *iface, DWORD writepos1, writepos2; EnterCriticalSection(&This->renderer.filter.csFilter); DSoundRender_UpdatePositions(This, &writepos1, &writepos2); - if (This->renderer.sink.pin.mtCurrent.pbFormat) + if (This->renderer.sink.pin.mt.pbFormat) { *pTime = This->play_time + time_from_pos(This, This->last_playpos); hr = S_OK; diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 8a921954dd..59f1cc5a18 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -651,7 +651,7 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_sourc
This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); - CopyMediaType(&This->pin.mtCurrent, pmt); + CopyMediaType(&This->pin.mt, pmt);
hr = IPin_ReceiveConnection(pReceivePin, &This->pin.IPin_iface, pmt);
@@ -659,7 +659,7 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_sourc { IPin_Release(This->pin.peer); This->pin.peer = NULL; - FreeMediaType(&This->pin.mtCurrent); + FreeMediaType(&This->pin.mt); }
TRACE(" -- %x\n", hr); diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index b7b1cb405e..e7c0e15edd 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -574,14 +574,14 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
iface->pin.peer = peer; IPin_AddRef(peer); - CopyMediaType(&iface->pin.mtCurrent, mt); + CopyMediaType(&iface->pin.mt, mt);
if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) { ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); IPin_Release(peer); iface->pin.peer = NULL; - FreeMediaType(&iface->pin.mtCurrent); + FreeMediaType(&iface->pin.mt); }
return hr; diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 0d72689078..73017290fb 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -933,14 +933,14 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
iface->pin.peer = peer; IPin_AddRef(peer); - CopyMediaType(&iface->pin.mtCurrent, mt); + CopyMediaType(&iface->pin.mt, mt);
if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) { ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); IPin_Release(peer); iface->pin.peer = NULL; - FreeMediaType(&iface->pin.mtCurrent); + FreeMediaType(&iface->pin.mt); }
return hr; diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index fa63b5b85c..e30da6b782 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -937,14 +937,14 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
iface->pin.peer = peer; IPin_AddRef(peer); - CopyMediaType(&iface->pin.mtCurrent, mt); + CopyMediaType(&iface->pin.mt, mt);
if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) { ok(hr == VFW_E_TYPE_NOT_ACCEPTED || hr == E_FAIL, "Got hr %#x.\n", hr); IPin_Release(peer); iface->pin.peer = NULL; - FreeMediaType(&iface->pin.mtCurrent); + FreeMediaType(&iface->pin.mt); }
return hr; diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 449bd31f68..18e5f618b0 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -394,7 +394,7 @@ static HRESULT WINAPI VideoRenderer_GetSourceRect(BaseControlVideo* iface, RECT static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo* iface, LONG *pBufferSize, LONG *pDIBImage) { VideoRendererImpl *This = impl_from_BaseControlVideo(iface); - AM_MEDIA_TYPE *amt = &This->renderer.sink.pin.mtCurrent; + AM_MEDIA_TYPE *amt = &This->renderer.sink.pin.mt; BITMAPINFOHEADER *bmiHeader; LONG needed_size; char *ptr; @@ -464,7 +464,7 @@ static VIDEOINFOHEADER* WINAPI VideoRenderer_GetVideoFormat(BaseControlVideo* if
TRACE("(%p/%p)\n", This, iface);
- pmt = &This->renderer.sink.pin.mtCurrent; + pmt = &This->renderer.sink.pin.mt; if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) { return (VIDEOINFOHEADER*)pmt->pbFormat; } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) { diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index a2ed46d05d..36c91c2ef7 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -198,7 +198,7 @@ static DWORD VMR9_SendSampleData(struct quartz_vmr *This, VMR9PresentationInfo *
TRACE("%p %p %d\n", This, data, size);
- amt = &This->renderer.sink.pin.mtCurrent; + amt = &This->renderer.sink.pin.mt;
if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo)) { @@ -609,7 +609,7 @@ static HRESULT WINAPI VMR9_GetSourceRect(BaseControlVideo* This, RECT *pSourceRe static HRESULT WINAPI VMR9_GetStaticImage(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage) { struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); - AM_MEDIA_TYPE *amt = &pVMR9->renderer.sink.pin.mtCurrent; + AM_MEDIA_TYPE *amt = &pVMR9->renderer.sink.pin.mt; BITMAPINFOHEADER *bmiHeader; LONG needed_size; char *ptr; @@ -679,7 +679,7 @@ static VIDEOINFOHEADER* WINAPI VMR9_GetVideoFormat(BaseControlVideo* This)
TRACE("(%p/%p)\n", pVMR9, This);
- pmt = &pVMR9->renderer.sink.pin.mtCurrent; + pmt = &pVMR9->renderer.sink.pin.mt; if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) { return (VIDEOINFOHEADER*)pmt->pbFormat; } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) { diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 9a88246a7f..c7f1ed2af4 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -196,8 +196,8 @@ HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface) { IPin_Release(This->peer); This->peer = NULL; - FreeMediaType(&This->mtCurrent); - ZeroMemory(&This->mtCurrent, sizeof(This->mtCurrent)); + FreeMediaType(&This->mt); + ZeroMemory(&This->mt, sizeof(This->mt)); hr = S_OK; } else @@ -245,7 +245,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt { if (This->peer) { - CopyMediaType(pmt, &This->mtCurrent); + CopyMediaType(pmt, &This->mt); strmbase_dump_media_type(pmt); hr = S_OK; } @@ -456,8 +456,8 @@ HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface) { IPin_Release(This->pin.peer); This->pin.peer = NULL; - FreeMediaType(&This->pin.mtCurrent); - ZeroMemory(&This->pin.mtCurrent, sizeof(This->pin.mtCurrent)); + FreeMediaType(&This->pin.mt); + ZeroMemory(&This->pin.mt, sizeof(This->pin.mt)); hr = S_OK; } else @@ -643,7 +643,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This,
This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); - CopyMediaType(&This->pin.mtCurrent, pmt); + CopyMediaType(&This->pin.mt, pmt);
hr = IPin_ReceiveConnection(pReceivePin, &This->pin.IPin_iface, pmt);
@@ -678,7 +678,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This, { IPin_Release(This->pin.peer); This->pin.peer = NULL; - FreeMediaType(&This->pin.mtCurrent); + FreeMediaType(&This->pin.mt); }
TRACE(" -- %x\n", hr); @@ -699,7 +699,7 @@ void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, str
void strmbase_source_cleanup(struct strmbase_source *pin) { - FreeMediaType(&pin->pin.mtCurrent); + FreeMediaType(&pin->pin.mt); if (pin->pAllocator) IMemAllocator_Release(pin->pAllocator); pin->pAllocator = NULL; @@ -750,7 +750,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
if (SUCCEEDED(hr)) { - CopyMediaType(&This->pin.mtCurrent, pmt); + CopyMediaType(&This->pin.mt, pmt); This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); } @@ -999,7 +999,7 @@ void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl, struct strmbase
void strmbase_sink_cleanup(BaseInputPin *pin) { - FreeMediaType(&pin->pin.mtCurrent); + FreeMediaType(&pin->pin.mt); if (pin->pAllocator) IMemAllocator_Release(pin->pAllocator); pin->pAllocator = NULL; diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 79328a025a..394b919df9 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1231,7 +1231,7 @@ static void gstdemux_destroy(struct strmbase_filter *iface) assert(hr == S_OK); }
- FreeMediaType(&filter->sink.mtCurrent); + FreeMediaType(&filter->sink.mt); if (filter->alloc) IMemAllocator_Release(filter->alloc); filter->alloc = NULL; @@ -2037,7 +2037,7 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, if (pAlloc) IMemAllocator_Release(pAlloc); if (SUCCEEDED(hr)) { - CopyMediaType(&filter->sink.mtCurrent, pmt); + CopyMediaType(&filter->sink.mt, pmt); filter->sink.peer = pReceivePin; IPin_AddRef(pReceivePin); hr = IMemAllocator_Commit(filter->alloc); diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 99539e5c89..a7da3b37d6 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -241,7 +241,7 @@ static void qt_splitter_destroy(struct strmbase_filter *iface) IPin_Release(peer); }
- FreeMediaType(&filter->pInputPin.pin.mtCurrent); + FreeMediaType(&filter->pInputPin.pin.mt); if (filter->pInputPin.pAlloc) IMemAllocator_Release(filter->pInputPin.pAlloc); filter->pInputPin.pAlloc = NULL; @@ -1120,7 +1120,7 @@ static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
if (SUCCEEDED(hr)) { - CopyMediaType(&This->pin.mtCurrent, pmt); + CopyMediaType(&This->pin.mt, pmt); This->pin.peer = pReceivePin; IPin_AddRef(pReceivePin); hr = IMemAllocator_Commit(This->pAlloc); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index f87b726d0a..01a2bc79c3 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -37,7 +37,7 @@ struct strmbase_pin PIN_DIRECTION dir; WCHAR name[128]; IPin *peer; - AM_MEDIA_TYPE mtCurrent; + AM_MEDIA_TYPE mt;
const struct BasePinFuncTable* pFuncsTable; };
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/pin.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index c7f1ed2af4..8c337ca471 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -366,6 +366,13 @@ HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const
EnterCriticalSection(&This->pin.filter->csFilter); { + if (This->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&This->pin.filter->csFilter); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + /* if we have been a specific type to connect with, then we can either connect * with that or fail. We cannot choose different AM_MEDIA_TYPE */ if (pmt && !IsEqualGUID(&pmt->majortype, &GUID_NULL) && !IsEqualGUID(&pmt->subtype, &GUID_NULL)) @@ -447,6 +454,13 @@ HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface)
EnterCriticalSection(&This->pin.filter->csFilter); { + if (This->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&This->pin.filter->csFilter); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + if (This->pMemInputPin) { IMemInputPin_Release(This->pMemInputPin); @@ -730,6 +744,13 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
EnterCriticalSection(&This->pin.filter->csFilter); { + if (This->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&This->pin.filter->csFilter); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + if (This->pin.peer) hr = VFW_E_ALREADY_CONNECTED;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=60445
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
quartz: filtergraph.c:3950: Test failed: Expected about 1334ms, got e3a940. filtergraph.c:3955: Test failed: Expected about 1334ms, got e3a940.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wineqtdecoder/qtsplitter.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index a7da3b37d6..2da0f691dc 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -234,12 +234,9 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
EnterCriticalSection(&filter->csReceive); /* Don't need to clean up output pins, disconnecting input pin will do that */ - IPin_ConnectedTo(&filter->pInputPin.pin.IPin_iface, &peer); - if (peer) - { - IPin_Disconnect(peer); - IPin_Release(peer); - } + + if (filter->pInputPin.pin.peer) + IPin_Disconnect(filter->pInputPin.pin.peer);
FreeMediaType(&filter->pInputPin.pin.mt); if (filter->pInputPin.pAlloc)
Avoids leaking the format block.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/videorenderer.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 18e5f618b0..b71d15a5d2 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -136,30 +136,23 @@ static void VideoRenderer_AutoShowWindow(VideoRendererImpl *This)
static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, DWORD size) { - AM_MEDIA_TYPE amt; - HRESULT hr = S_OK; + const AM_MEDIA_TYPE *amt = &This->renderer.sink.pin.mt; BITMAPINFOHEADER *bmiHeader; HDC dc;
TRACE("(%p)->(%p, %d)\n", This, data, size);
- hr = IPin_ConnectionMediaType(&This->renderer.sink.pin.IPin_iface, &amt); - if (FAILED(hr)) { - ERR("Unable to retrieve media type\n"); - return hr; - } - - if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo)) + if (IsEqualGUID(&amt->formattype, &FORMAT_VideoInfo)) { - bmiHeader = &((VIDEOINFOHEADER *)amt.pbFormat)->bmiHeader; + bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader; } - else if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo2)) + else if (IsEqualGUID(&amt->formattype, &FORMAT_VideoInfo2)) { - bmiHeader = &((VIDEOINFOHEADER2 *)amt.pbFormat)->bmiHeader; + bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader; } else { - FIXME("Unknown type %s\n", debugstr_guid(&amt.subtype)); + FIXME("Unknown subtype %s.\n", debugstr_guid(&amt->subtype)); return VFW_E_RUNTIME_ERROR; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/outputqueue.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/dlls/strmbase/outputqueue.c b/dlls/strmbase/outputqueue.c index ee05653d7a..dbcc4b6d0d 100644 --- a/dlls/strmbase/outputqueue.c +++ b/dlls/strmbase/outputqueue.c @@ -177,6 +177,8 @@ VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue)
VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue) { + IPin *peer; + EnterCriticalSection(&pOutputQueue->csQueue); if (pOutputQueue->hThread) { @@ -191,16 +193,8 @@ VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue) qev->pSample = NULL; list_add_tail(&pOutputQueue->SampleList, &qev->entry); } - else - { - IPin* ppin = NULL; - IPin_ConnectedTo(&pOutputQueue->pInputPin->pin.IPin_iface, &ppin); - if (ppin) - { - IPin_EndOfStream(ppin); - IPin_Release(ppin); - } - } + else if ((peer = pOutputQueue->pInputPin->pin.peer)) + IPin_EndOfStream(peer); LeaveCriticalSection(&pOutputQueue->csQueue); /* Covers sending the Event to the worker Thread */ OutputQueue_SendAnyway(pOutputQueue); @@ -259,13 +253,9 @@ DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue) QueuedEvent *qev = LIST_ENTRY(cursor, QueuedEvent, entry); if (qev->type == EOS_PACKET) { - IPin* ppin = NULL; - IPin_ConnectedTo(&pOutputQueue->pInputPin->pin.IPin_iface, &ppin); - if (ppin) - { - IPin_EndOfStream(ppin); - IPin_Release(ppin); - } + IPin *peer; + if ((peer = pOutputQueue->pInputPin->pin.peer)) + IPin_EndOfStream(peer); } else if (qev->type == SAMPLE_PACKET) break;