From: Yuxuan Shui yshui@codeweavers.com
Fixes: 075033d61ffac2a8d42e06e91a12c88f2fa17401 --- dlls/winegstreamer/wm_reader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index fe033285a2c..b5065c57c05 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -2417,8 +2417,8 @@ static HRESULT WINAPI reader_SetOutputProps(IWMSyncReader2 *iface, DWORD output,
if (!(stream = get_stream_by_output_number(reader, output))) { - LeaveCriticalSection(&reader->cs); - return E_INVALIDARG; + hr = E_INVALIDARG; + goto out; }
wg_parser_stream_get_current_format(stream->wg_stream, &pref_format); @@ -2456,8 +2456,7 @@ static HRESULT WINAPI reader_SetOutputProps(IWMSyncReader2 *iface, DWORD output, if (FAILED(hr)) { WARN("Unsupported media type, returning %#lx.\n", hr); - LeaveCriticalSection(&reader->cs); - return hr; + goto out; }
stream->format = format; @@ -2479,10 +2478,11 @@ static HRESULT WINAPI reader_SetOutputProps(IWMSyncReader2 *iface, DWORD output, wg_parser_stream_seek(reader->streams[0].wg_stream, 1.0, reader->start_time, 0, AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning);
+out: LeaveCriticalSection(&reader->cs); if (WaitForSingleObject(reader->read_sem, INFINITE) != WAIT_OBJECT_0) ERR("Failed to wait for read thread to pause.\n"); - return S_OK; + return hr; }
static HRESULT WINAPI reader_SetOutputSetting(IWMSyncReader2 *iface, DWORD output,