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

winegstreamer: Return E_UNEXPECTED from WMReader_Open when already opened.

parent d54b1945
......@@ -222,6 +222,13 @@ static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url,
EnterCriticalSection(&reader->reader.cs);
if (reader->reader.wg_parser)
{
LeaveCriticalSection(&reader->reader.cs);
WARN("Stream is already open; returning E_UNEXPECTED.\n");
return E_UNEXPECTED;
}
if (SUCCEEDED(hr = wm_reader_open_file(&reader->reader, url)))
open_stream(reader, callback, context);
......
......@@ -2541,6 +2541,9 @@ static void test_async_reader_file(void)
ret = WaitForSingleObject(callback.got_opened, 1000);
ok(!ret, "Wait timed out.\n");
hr = IWMReader_Open(reader, filename, &callback.IWMReaderCallback_iface, (void **)0xdeadbee0);
ok(hr == E_UNEXPECTED, "Got hr %#lx.\n", hr);
count = 0xdeadbeef;
hr = IWMReader_GetOutputCount(reader, &count);
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