Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/winegstreamer/wm_reader.c | 21 +++++++++++++++++++++ dlls/wmvcore/tests/wmvcore.c | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 80393d4e7a1..bd7fcd06bd3 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -910,6 +910,27 @@ static HRESULT WINAPI header_info_GetAttributeByName(IWMHeaderInfo3 *iface, WORD memcpy(value, &duration, sizeof(QWORD)); return S_OK; } + else if (!wcscmp(name, L"Seekable")) + { + if (*stream_number) + { + WARN("Requesting duration for stream %u, returning ASF_E_NOTFOUND.\n", *stream_number); + return ASF_E_NOTFOUND; + } + + *size = sizeof(BOOL); + if (!value) + { + *type = WMT_TYPE_BOOL; + return S_OK; + } + if (req_size < *size) + return ASF_E_BUFFERTOOSMALL; + + *type = WMT_TYPE_BOOL; + *(BOOL *)value = TRUE; + return S_OK; + } else { FIXME("Unknown attribute %s.\n", debugstr_w(name)); diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 6d510553fef..92208c0b8a3 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -468,6 +468,17 @@ static void test_reader_attributes(IWMProfile *profile) ok(ret_stream_number == stream_number, "Expected stream number %u, got %u.\n", stream_number, ret_stream_number);
+ size = sizeof(DWORD); + type = 0xdeadbeef; + dword = 0xdeadbeef; + hr = IWMHeaderInfo_GetAttributeByName(header_info, &ret_stream_number, + L"Seekable", &type, (BYTE *)&dword, &size); + ok(hr == ASF_E_NOTFOUND, "Got hr %#x.\n", hr); + ok(type == 0xdeadbeef, "Got type %#x.\n", type); + ok(size == sizeof(DWORD), "Got size %u.\n", size); + ok(ret_stream_number == stream_number, "Expected stream number %u, got %u.\n", + stream_number, ret_stream_number); + IWMStreamConfig_Release(config); }
@@ -546,6 +557,17 @@ static void test_reader_attributes(IWMProfile *profile) ok(size == sizeof(QWORD), "Got size %u.\n", size); ok(stream_number == 0, "Got stream number %u.\n", stream_number);
+ size = sizeof(DWORD); + type = 0xdeadbeef; + dword = 0xdeadbeef; + hr = IWMHeaderInfo_GetAttributeByName(header_info, &stream_number, + L"Seekable", &type, (BYTE *)&dword, &size); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(type == WMT_TYPE_BOOL, "Got type %#x.\n", type); + ok(size == sizeof(DWORD), "Got size %u.\n", size); + ok(dword == TRUE, "Got duration %I64u.\n", duration); + ok(stream_number == 0, "Got stream number %u.\n", stream_number); + IWMHeaderInfo_Release(header_info); }