winegstreamer: Implement IWMProfile::GetStreamCount().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-10-25 18:52:13 -05:00 committed by Alexandre Julliard
parent 51b6d45503
commit 87e4c289e4
3 changed files with 11 additions and 3 deletions

View File

@ -129,6 +129,8 @@ struct wm_reader
bool read_thread_shutdown;
struct wg_parser *wg_parser;
WORD stream_count;
const struct wm_reader_ops *ops;
};

View File

@ -188,12 +188,16 @@ static HRESULT WINAPI profile_SetDescription(IWMProfile3 *iface, const WCHAR *de
static HRESULT WINAPI profile_GetStreamCount(IWMProfile3 *iface, DWORD *count)
{
FIXME("iface %p, count %p, stub!\n", iface, count);
struct wm_reader *reader = impl_from_IWMProfile3(iface);
TRACE("reader %p, count %p.\n", reader, count);
if (!count)
return E_INVALIDARG;
*count = 0;
EnterCriticalSection(&reader->cs);
*count = reader->stream_count;
LeaveCriticalSection(&reader->cs);
return S_OK;
}
@ -853,6 +857,8 @@ HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream)
goto out_shutdown_thread;
}
reader->stream_count = wg_parser_get_stream_count(reader->wg_parser);
LeaveCriticalSection(&reader->cs);
return S_OK;

View File

@ -459,7 +459,7 @@ static void test_sync_reader_streaming(void)
count = 0xdeadbeef;
hr = IWMProfile_GetStreamCount(profile, &count);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(count == 2, "Got count %u.\n", count);
ok(count == 2, "Got count %u.\n", count);
count = 0xdeadbeef;
hr = IWMSyncReader_GetOutputCount(reader, &count);