Module: wine
Branch: master
Commit: 4853f65c844de8277b8b0420df1a2cdb1c5b17c8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4853f65c844de8277b8b0420…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Wed Feb 9 09:40:52 2022 +0100
winegstreamer: Do not block forever if EOS races with command queue.
Currently, the winegstreamer media source checks for EOS when
RequestSample() is called, but doesn't handle the cases when EOS
is detected between the RequestSample() call and the moment when
the request is popped from the command queue and serviced. This
can result in the media source waiting forever for a sample and
get stuck.
This commit fixes the bug by adding a check for EOS in
wait_for_event().
This commit fixes Medieval Dynasty hanging on developer logos on
the Steam Deck.
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/winegstreamer/media_source.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index e40974bf73a..32006964f3b 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -535,6 +535,12 @@ static void wait_on_sample(struct media_stream *stream, IUnknown *token)
TRACE("%p, %p\n", stream, token);
+ if (stream->eos)
+ {
+ IMFMediaEventQueue_QueueEventParamVar(stream->event_queue, MEError, &GUID_NULL, MF_E_END_OF_STREAM, &empty_var);
+ return;
+ }
+
for (;;)
{
if (!wg_parser_stream_get_event(stream->wg_stream, &event))