Commit c3811e84 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Implement IWMHeaderInfo::GetAttributeByName(L"Seekable").

parent 799c7704
......@@ -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));
......
......@@ -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);
}
......
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