Skip to content

Commit

Permalink
qcap: Use IMemAllocator::GetBuffer() and IMediaSample::SetTime() dire…
Browse files Browse the repository at this point in the history
…ctly.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
  • Loading branch information
Zebediah Figura authored and julliard committed Feb 7, 2022
1 parent 859809b commit ed4df69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions dlls/qcap/avico.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,14 @@ static HRESULT WINAPI AVICompressorIn_Receive(struct strmbase_sink *base, IMedia
return hres;
}

hres = BaseOutputPinImpl_GetDeliveryBuffer(&This->source, &out_sample, &start, &stop, 0);
if(FAILED(hres))
if (FAILED(hres = IMemAllocator_GetBuffer(This->source.pAllocator, &out_sample, &start, &stop, 0)))
{
ERR("Failed to get sample, hr %#x.\n", 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);
if(FAILED(hres))
Expand Down
2 changes: 1 addition & 1 deletion dlls/qcap/vfwcapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static DWORD WINAPI stream_thread(void *arg)

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);
break;
Expand Down

0 comments on commit ed4df69

Please sign in to comment.