Commit 8492657a authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

amstream: Release filter critical section before calling upstream seeking methods.

Otherwise a seek might deadlock when the stream calls the filter methods (e.g. WaitUntil) from streaming thread. Signed-off-by: 's avatarAnton Baskanov <baskanov@gmail.com> Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f2cfd63c
......@@ -795,15 +795,16 @@ static HRESULT WINAPI filter_seeking_GetDuration(IMediaSeeking *iface, LONGLONG
EnterCriticalSection(&filter->cs);
if (!(seeking = get_seeking(filter->seekable_stream)))
{
LeaveCriticalSection(&filter->cs);
seeking = get_seeking(filter->seekable_stream);
LeaveCriticalSection(&filter->cs);
if (!seeking)
return E_NOTIMPL;
}
hr = IMediaSeeking_GetDuration(seeking, duration);
IMediaSeeking_Release(seeking);
LeaveCriticalSection(&filter->cs);
return hr;
}
......@@ -817,15 +818,16 @@ static HRESULT WINAPI filter_seeking_GetStopPosition(IMediaSeeking *iface, LONGL
EnterCriticalSection(&filter->cs);
if (!(seeking = get_seeking(filter->seekable_stream)))
{
LeaveCriticalSection(&filter->cs);
seeking = get_seeking(filter->seekable_stream);
LeaveCriticalSection(&filter->cs);
if (!seeking)
return E_NOTIMPL;
}
hr = IMediaSeeking_GetStopPosition(seeking, stop);
IMediaSeeking_Release(seeking);
LeaveCriticalSection(&filter->cs);
return hr;
}
......@@ -860,18 +862,15 @@ static HRESULT WINAPI filter_seeking_SetPositions(IMediaSeeking *iface, LONGLONG
seeking = get_seeking(filter->seekable_stream);
LeaveCriticalSection(&filter->cs);
if (!seeking)
{
LeaveCriticalSection(&filter->cs);
return E_NOTIMPL;
}
hr = IMediaSeeking_SetPositions(seeking, current_ptr, current_flags, stop_ptr, stop_flags);
IMediaSeeking_Release(seeking);
LeaveCriticalSection(&filter->cs);
return 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