Commit fa3fa0e3 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Acquire all of the flushing locks in GST_Seeking_SetPositions().

The current code unintentionally repeatedly acquires the lock for the stream currently being seeked. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50906Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8138159f
...@@ -1327,8 +1327,10 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, ...@@ -1327,8 +1327,10 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface,
* ensures the seek is serialized between flushes. */ * ensures the seek is serialized between flushes. */
for (i = 0; i < filter->source_count; ++i) for (i = 0; i < filter->source_count; ++i)
{ {
if (filter->sources[i]->pin.pin.peer) struct parser_source *flush_pin = filter->sources[i];
EnterCriticalSection(&pin->flushing_cs);
if (flush_pin->pin.pin.peer)
EnterCriticalSection(&flush_pin->flushing_cs);
} }
SourceSeekingImpl_SetPositions(iface, current, current_flags, stop, stop_flags); SourceSeekingImpl_SetPositions(iface, current, current_flags, stop, stop_flags);
...@@ -1342,8 +1344,10 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, ...@@ -1342,8 +1344,10 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface,
for (i = 0; i < filter->source_count; ++i) for (i = 0; i < filter->source_count; ++i)
{ {
if (filter->sources[i]->pin.pin.peer) struct parser_source *flush_pin = filter->sources[i];
IPin_EndFlush(filter->sources[i]->pin.pin.peer);
if (flush_pin->pin.pin.peer)
IPin_EndFlush(flush_pin->pin.pin.peer);
} }
if (filter->reader) if (filter->reader)
...@@ -1353,8 +1357,10 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, ...@@ -1353,8 +1357,10 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface,
/* Release the flushing locks. */ /* Release the flushing locks. */
for (i = filter->source_count - 1; i >= 0; --i) for (i = filter->source_count - 1; i >= 0; --i)
{ {
if (filter->sources[i]->pin.pin.peer) struct parser_source *flush_pin = filter->sources[i];
LeaveCriticalSection(&pin->flushing_cs);
if (flush_pin->pin.pin.peer)
LeaveCriticalSection(&flush_pin->flushing_cs);
} }
return S_OK; return S_OK;
......
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