[PATCH v2 4/4] winegstreamer: Implement IWMProfile::GetStreamCount().
Zebediah Figura
zfigura at codeweavers.com
Mon Oct 25 18:52:13 CDT 2021
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
dlls/winegstreamer/gst_private.h | 2 ++
dlls/winegstreamer/wm_reader.c | 10 ++++++++--
dlls/wmvcore/tests/wmvcore.c | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index caa449956bf..86ddc3c85c8 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -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;
};
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index 163eebf8c55..689d2232b73 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -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;
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index 89a6640af2d..efcadc7f7a6 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -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);
--
2.33.0
More information about the wine-devel
mailing list