qcap: Use IMemAllocator::GetBuffer() and IMediaSample::SetTime() directly.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-02-06 20:59:42 -06:00 committed by Alexandre Julliard
parent 859809be48
commit ed4df6964c
2 changed files with 8 additions and 3 deletions

View file

@ -350,9 +350,14 @@ static HRESULT WINAPI AVICompressorIn_Receive(struct strmbase_sink *base, IMedia
return hres; return hres;
} }
hres = BaseOutputPinImpl_GetDeliveryBuffer(&This->source, &out_sample, &start, &stop, 0); if (FAILED(hres = IMemAllocator_GetBuffer(This->source.pAllocator, &out_sample, &start, &stop, 0)))
if(FAILED(hres)) {
ERR("Failed to get sample, hr %#x.\n", hres);
return hres; return hres;
}
if (FAILED(hres = IMediaSample_SetTime(out_sample, &start, &stop)))
ERR("Failed to set time, hr %#x.\n", hres);
hres = IMediaSample_GetPointer(out_sample, &buf); hres = IMediaSample_GetPointer(out_sample, &buf);
if(FAILED(hres)) if(FAILED(hres))

View file

@ -165,7 +165,7 @@ static DWORD WINAPI stream_thread(void *arg)
LeaveCriticalSection(&filter->state_cs); LeaveCriticalSection(&filter->state_cs);
if (FAILED(hr = BaseOutputPinImpl_GetDeliveryBuffer(&filter->source, &sample, NULL, NULL, 0))) if (FAILED(hr = IMemAllocator_GetBuffer(filter->source.pAllocator, &sample, NULL, NULL, 0)))
{ {
ERR("Failed to get sample, hr %#x.\n", hr); ERR("Failed to get sample, hr %#x.\n", hr);
break; break;