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

winegstreamer: Return E_UNEXPECTED from WMReaderAdvanced2_OpenStream when already opened.

parent d6af590a
......@@ -725,6 +725,13 @@ static HRESULT WINAPI WMReaderAdvanced2_OpenStream(IWMReaderAdvanced6 *iface,
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_stream(&reader->reader, stream)))
open_stream(reader, callback, context);
......
......@@ -2181,6 +2181,9 @@ static void test_async_reader_streaming(void)
ret = WaitForSingleObject(callback.got_opened, 1000);
ok(!ret, "Wait timed out.\n");
hr = IWMReaderAdvanced2_OpenStream(advanced, &stream.IStream_iface, &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