diff --git a/dlls/quartz/avidec.c b/dlls/quartz/avidec.c index 37aaaab13ff..c4382671c48 100644 --- a/dlls/quartz/avidec.c +++ b/dlls/quartz/avidec.c @@ -124,10 +124,7 @@ static DWORD AVIDec_SendSampleData(AVIDecImpl* This, LPBYTE data, DWORD size) goto error; } - return S_OK; - error: - /* If we have a sample that has not been delivered, release it */ if (pSample) IMediaSample_Release(pSample); @@ -174,9 +171,6 @@ static HRESULT AVIDec_Sample(LPVOID iface, IMediaSample * pSample) AVIDec_SendSampleData(This, pbSrcStream, cbSrcStream); - /* We have finished with the incoming sample, we must release it now */ - IMediaSample_Release(pSample); - return S_OK; } diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c index 644ce7a19dc..098ce005afb 100644 --- a/dlls/quartz/avisplit.c +++ b/dlls/quartz/avisplit.c @@ -680,8 +680,7 @@ static HRESULT AVISplitter_Sample(LPVOID iface, IMediaSample * pSample) ERR("Error sending sample (%lx)\n", hr); } - /* If we have a sample that has not been delivered, release it */ - if (FAILED(hr) && This->pCurrentSample) + if (This->pCurrentSample) IMediaSample_Release(This->pCurrentSample); This->pCurrentSample = NULL; diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 9191a7acd1e..808ae2146ac 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -184,7 +184,7 @@ static DWORD DSoundRender_SendSampleData(DSoundRenderImpl* This, LPBYTE data, DW ERR("Unable to lock sound buffer !\n"); break; } - TRACE("write_pos=%ld, size=%ld, sz1=%ld, sz2=%ld\n", This->write_pos, size2, dwsize1, dwsize2); + /* TRACE("write_pos=%ld, size=%ld, sz1=%ld, sz2=%ld\n", This->write_pos, size2, dwsize1, dwsize2); */ memcpy(lpbuf1, data, dwsize1); if (dwsize2) { @@ -260,9 +260,6 @@ static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample) } } DSoundRender_SendSampleData(This, pbSrcStream, cbSrcStream); - - /* We have finished with the incoming sample, we must release it now */ - IMediaSample_Release(pSample); return S_OK; } diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index bddc9b0ea51..7c8877d1837 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -140,7 +140,7 @@ static ULONG WINAPI BaseMemAllocator_AddRef(IMemAllocator * iface) { BaseMemAllocator *This = (BaseMemAllocator *)iface; - TRACE("()\n"); + TRACE("(%p)->() AddRef from %ld\n", iface, This->ref); return InterlockedIncrement(&This->ref); } @@ -149,7 +149,7 @@ static ULONG WINAPI BaseMemAllocator_Release(IMemAllocator * iface) { BaseMemAllocator *This = (BaseMemAllocator *)iface; - TRACE("()\n"); + TRACE("(%p)->() Release from %ld\n", iface, This->ref); if (!InterlockedDecrement(&This->ref)) { @@ -634,8 +634,12 @@ static HRESULT WINAPI StdMediaSample2_GetMediaType(IMediaSample2 * iface, AM_MED TRACE("(%p)\n", ppMediaType); - if (!This->props.pMediaType) + if (!This->props.pMediaType) { + /* Make sure we return a NULL pointer (required by native Quartz dll) */ + if (ppMediaType) + *ppMediaType = NULL; return S_FALSE; + } if (!(*ppMediaType = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)))) return E_OUTOFMEMORY; diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 14cf5734c97..0eb5af35b56 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -222,8 +222,21 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, *(ptr + i*psz + 3 + j * sdesc.u1.lPitch) = 0xFF; } } + else if (format->bmiHeader.biBitCount == 32) + { + int psz = sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 32 ? 4 : 3; + for (j = 0; j < height; j++) + for (i = 0; i < width; i++) + { + *(ptr + i*psz + 0 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*4 + 0); + *(ptr + i*psz + 1 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*4 + 1); + *(ptr + i*psz + 2 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*4 + 2); + if (psz == 4) + *(ptr + i*psz + 3 + j * sdesc.u1.lPitch) = 0xFF; + } + } else - FIXME("Source size with a depths other than paletted 8 bits are not yet supported\n"); + FIXME("Source size with a depths other than paletted 8 or 32 bits are not yet supported\n"); } else FIXME("Destination depths with a depth other than 24 or 32 bits are not yet supported\n"); @@ -293,9 +306,6 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample) VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream); - /* We have finished with the incoming sample, we must release it now */ - IMediaSample_Release(pSample); - return S_OK; }