Sometimes streaming thread gets stuck in IPin::EndOfStream trying to acquire the filter critical section for more than 1 second, causing intermittent test failures.
Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/quartz/dsoundrender.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 68c88ea5a15..317a862dc02 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -648,10 +648,14 @@ static HRESULT dsound_render_cleanup_stream(struct strmbase_filter *iface) static HRESULT dsound_render_wait_state(struct strmbase_filter *iface, DWORD timeout) { struct dsound_render *filter = impl_from_strmbase_filter(iface); + HRESULT hr = S_OK;
+ LeaveCriticalSection(&filter->filter.filter_cs); if (WaitForSingleObject(filter->state_event, timeout) == WAIT_TIMEOUT) - return VFW_S_STATE_INTERMEDIATE; - return S_OK; + hr = VFW_S_STATE_INTERMEDIATE; + EnterCriticalSection(&filter->filter.filter_cs); + + return hr; }
static const struct strmbase_filter_ops filter_ops =