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/strmbase/renderer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 01fabfc98de..150d712806a 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -290,10 +290,14 @@ static HRESULT renderer_cleanup_stream(struct strmbase_filter *iface) static HRESULT renderer_wait_state(struct strmbase_filter *iface, DWORD timeout) { struct strmbase_renderer *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 =
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 =
On 5/28/21 2:05 AM, Anton Baskanov wrote:
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
Sorry for the late review.
The streaming thread shouldn't be doing that; that's basically one of the underdocumented rules of quartz, you can't access the filter CS from the streaming thread.
I'm presuming this is the part where it tries to check "pin->flushing"; this is basically wrong as-is, but it needs some extra work to solve, including (ideally) wineqtdecoder either being restructured or going away entirely.
There is also one in pin_ConnectedTo, which is called like this:
sink_EndOfStream() -> sink_eos() -> strmbase_passthrough_eos() -> MediaSeekingPassThru_GetStopPosition() -> get_connected() -> pin_ConnectedTo().
It is this one that causes problems for me. We should probably get rid of both to fix the test failures.
On суббота, 5 июня 2021 г. 05:02:09 +07 you wrote:
On 5/28/21 2:05 AM, Anton Baskanov wrote:
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
Sorry for the late review.
The streaming thread shouldn't be doing that; that's basically one of the underdocumented rules of quartz, you can't access the filter CS from the streaming thread.
I'm presuming this is the part where it tries to check "pin->flushing"; this is basically wrong as-is, but it needs some extra work to solve, including (ideally) wineqtdecoder either being restructured or going away entirely.