Commit 957ac08c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Use IWMSyncReader2_GetAllocateForOutput in the async reader.

parent 8de2ec5f
...@@ -879,13 +879,21 @@ static HRESULT WINAPI WMReaderAdvanced_SetAllocateForOutput(IWMReaderAdvanced6 * ...@@ -879,13 +879,21 @@ static HRESULT WINAPI WMReaderAdvanced_SetAllocateForOutput(IWMReaderAdvanced6 *
return IWMSyncReader2_SetAllocateForOutput(reader->reader, output, allocate ? reader->allocator : NULL); return IWMSyncReader2_SetAllocateForOutput(reader->reader, output, allocate ? reader->allocator : NULL);
} }
static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output_num, BOOL *allocate) static HRESULT WINAPI WMReaderAdvanced_GetAllocateForOutput(IWMReaderAdvanced6 *iface, DWORD output, BOOL *allocate)
{ {
struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface); struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
IWMReaderAllocatorEx *allocator;
HRESULT hr;
FIXME("reader %p, output %lu, allocate %p, stub!\n", reader, output_num, allocate); TRACE("reader %p, output %lu, allocate %p.\n", reader, output, allocate);
return E_NOTIMPL; if (FAILED(hr = IWMSyncReader2_GetAllocateForOutput(reader->reader, output, &allocator)))
return hr;
if ((*allocate = allocator != NULL))
IWMReaderAllocatorEx_Release(allocator);
return hr;
} }
static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface, static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *iface,
......
...@@ -2505,15 +2505,13 @@ static void test_async_reader_allocate(IWMReader *reader, ...@@ -2505,15 +2505,13 @@ static void test_async_reader_allocate(IWMReader *reader,
callback->allocated_samples = true; callback->allocated_samples = true;
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr == S_OK) ok(!allocate, "Got allocate %d.\n", allocate);
ok(!allocate, "Got allocate %d.\n", allocate);
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr == S_OK) ok(!allocate, "Got allocate %d.\n", allocate);
ok(!allocate, "Got allocate %d.\n", allocate);
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 2, &allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 2, &allocate);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 0, &allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 0, &allocate);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
...@@ -2536,13 +2534,11 @@ static void test_async_reader_allocate(IWMReader *reader, ...@@ -2536,13 +2534,11 @@ static void test_async_reader_allocate(IWMReader *reader,
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr == S_OK) ok(allocate == TRUE, "Got allocate %d.\n", allocate);
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr == S_OK) ok(allocate == TRUE, "Got allocate %d.\n", allocate);
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
...@@ -2572,13 +2568,11 @@ static void test_async_reader_allocate(IWMReader *reader, ...@@ -2572,13 +2568,11 @@ static void test_async_reader_allocate(IWMReader *reader,
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 0, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr == S_OK) ok(!allocate, "Got allocate %d.\n", allocate);
ok(!allocate, "Got allocate %d.\n", allocate);
hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate); hr = IWMReaderAdvanced2_GetAllocateForOutput(advanced, 1, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); ok(hr == S_OK, "Got hr %#lx.\n", hr);
if (hr == S_OK) ok(!allocate, "Got allocate %d.\n", allocate);
ok(!allocate, "Got allocate %d.\n", allocate);
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate); hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
......
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