Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/dsoundrender.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index a444297f568..c07dec56c09 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -64,7 +64,6 @@ struct dsound_render IDirectSound8 *dsound; LPDIRECTSOUNDBUFFER dsbuffer; DWORD buf_size; - DWORD in_loop; DWORD last_playpos, writepos;
REFERENCE_TIME play_time; @@ -238,11 +237,9 @@ static HRESULT DSoundRender_HandleEndOfStream(struct dsound_render *This) if (pos1 == pos2) break;
- This->in_loop = 1; LeaveCriticalSection(&This->stream_cs); WaitForSingleObject(This->flush_event, 10); EnterCriticalSection(&This->stream_cs); - This->in_loop = 0; }
return S_OK; @@ -263,11 +260,9 @@ static HRESULT DSoundRender_SendSampleData(struct dsound_render *This, hr = S_FALSE;
if (hr != S_OK) { - This->in_loop = 1; LeaveCriticalSection(&This->stream_cs); ret = WaitForSingleObject(This->flush_event, 10); EnterCriticalSection(&This->stream_cs); - This->in_loop = 0; if (This->sink.flushing || This->filter.state == State_Stopped) return This->filter.state == State_Paused ? S_OK : VFW_E_WRONG_STATE; if (ret != WAIT_TIMEOUT)
We don't grab stream_cs to change any variables checked here, except to reset flush_event, and that cannot result in a deadlock.
The only possible deadlocks here are:
(1) between this function and Receive(), which is correct, as the two should presumably be serialized;
(2) between this function and EndFlush(); however, in that case we expect BeginFlush() first, which will unblock the streaming thread.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/dsoundrender.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index c07dec56c09..d00c9e92570 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -237,9 +237,7 @@ static HRESULT DSoundRender_HandleEndOfStream(struct dsound_render *This) if (pos1 == pos2) break;
- LeaveCriticalSection(&This->stream_cs); WaitForSingleObject(This->flush_event, 10); - EnterCriticalSection(&This->stream_cs); }
return S_OK;
We don't grab stream_cs to change any variables checked here, except to reset flush_event, and that cannot result in a deadlock.
The only possible deadlocks here are:
(1) between this function and EndOfStream(), which is correct, as the two should presumably be serialized;
(2) between this function and EndFlush(); however, in that case we expect BeginFlush() first, which will unblock the streaming thread.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/dsoundrender.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index d00c9e92570..fc64eae8f72 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -258,9 +258,7 @@ static HRESULT DSoundRender_SendSampleData(struct dsound_render *This, hr = S_FALSE;
if (hr != S_OK) { - LeaveCriticalSection(&This->stream_cs); ret = WaitForSingleObject(This->flush_event, 10); - EnterCriticalSection(&This->stream_cs); if (This->sink.flushing || This->filter.state == State_Stopped) return This->filter.state == State_Paused ? S_OK : VFW_E_WRONG_STATE; if (ret != WAIT_TIMEOUT)
We don't grab stream_cs to change any variables checked here, except to reset flush_event, and that cannot result in a deadlock.
The only possible deadlocks here are:
(1) between this function and EndOfStream(), which is correct, as the two should presumably be serialized;
(2) between this function and EndFlush(); however, in that case we expect BeginFlush() first, which will unblock the streaming thread.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/renderer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index dde56b7a346..24d209703ca 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -224,18 +224,15 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp IReferenceClock_AdviseTime(filter->filter.clock, filter->stream_start, start, (HEVENT)filter->advise_event, &cookie);
- LeaveCriticalSection(&filter->csRenderLock); - ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE); IReferenceClock_Unadvise(filter->filter.clock, cookie);
if (ret == 1) { + LeaveCriticalSection(&filter->csRenderLock); TRACE("Flush signaled; discarding current sample.\n"); return S_OK; } - - EnterCriticalSection(&filter->csRenderLock); } }
We don't grab stream_cs to change any variables checked here, except to reset flush_event, and that cannot result in a deadlock.
The only possible deadlocks here are:
(1) between this function and EndOfStream(), which is correct, as the two should presumably be serialized;
(2) between this function and EndFlush(); however, in that case we expect BeginFlush() first, which will unblock the streaming thread.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/nullrenderer.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/qedit/nullrenderer.c b/dlls/qedit/nullrenderer.c index a8594eade8b..97e3cdbb202 100644 --- a/dlls/qedit/nullrenderer.c +++ b/dlls/qedit/nullrenderer.c @@ -46,9 +46,7 @@ static HRESULT WINAPI NullRenderer_DoRenderSample(struct strmbase_renderer *ifac const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event};
SetEvent(filter->renderer.state_event); - LeaveCriticalSection(&filter->renderer.csRenderLock); WaitForMultipleObjects(2, events, FALSE, INFINITE); - EnterCriticalSection(&filter->renderer.csRenderLock); }
return S_OK;