Module: wine Branch: master Commit: 8d3392a8ce4e75eaca858c2c96f666f1ab57834e URL: http://source.winehq.org/git/wine.git/?a=commit;h=8d3392a8ce4e75eaca858c2c96...
Author: Akihiro Sagawa sagawa.aki@gmail.com Date: Wed Nov 9 22:28:20 2016 +0900
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 068593b23826c995f03559128041b922b68a916b.
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/winegstreamer/gstdemux.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 5db99c8..a6a41ab 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -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;