winegstreamer: Always pass non-NULL preferred allocator to IAsyncReader::RequestAllocator.
Andrew Eikum
aeikum at codeweavers.com
Wed Nov 9 08:53:21 CST 2016
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Seems reasonable to me. If you want to submit a patch for
wineqtdecoder, I can at least compile-test it.
Andrew
On Wed, Nov 09, 2016 at 10:28:20PM +0900, Akihiro Sagawa wrote:
> This fixes video playback issue in a certain application.
> The approach is very similar to 068593b23826c995f03559128041b922b68a916b.
>
> Andrew, could you take a look this patch and
> dlls/wineqtdecoder/qtsplitter.c:1154?
> It seems that wineqtdecoder needs a fix, too. But, I don't have test
> environment.
>
> Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
> ---
> 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;
More information about the wine-patches
mailing list