Commit 8d3392a8 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

winegstreamer: Always pass non-NULL preferred allocator to IAsyncReader::RequestAllocator.

This fixes video playback issue in a certain application. The approach is very similar to 068593b2. Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 474288a0
......@@ -1963,6 +1963,7 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
EnterCriticalSection(This->pin.pCritSec);
if (!This->pin.pConnectedTo) {
ALLOCATOR_PROPERTIES props;
IMemAllocator *pAlloc = NULL;
props.cBuffers = 8;
props.cbBuffer = 16384;
......@@ -1986,8 +1987,19 @@ static HRESULT WINAPI GSTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
hr = IPin_QueryInterface(pReceivePin, &IID_IAsyncReader, (LPVOID *)&This->pReader);
if (SUCCEEDED(hr))
hr = GST_Connect(This, pReceivePin, &props);
/* A certain IAsyncReader::RequestAllocator expects to be passed
non-NULL preferred allocator */
if (SUCCEEDED(hr))
hr = IAsyncReader_RequestAllocator(This->pReader, NULL, &props, &This->pAlloc);
hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
&IID_IMemAllocator, (LPVOID *)&pAlloc);
if (SUCCEEDED(hr)) {
hr = IAsyncReader_RequestAllocator(This->pReader, pAlloc, &props, &This->pAlloc);
if (FAILED(hr))
WARN("Can't get an allocator, got %08x\n", hr);
}
if (pAlloc)
IMemAllocator_Release(pAlloc);
if (SUCCEEDED(hr)) {
CopyMediaType(&This->pin.mtCurrent, pmt);
This->pin.pConnectedTo = pReceivePin;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment