From 2e265566431bfb7e2d2aeed5e23f898a978f36b7 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 17 May 2021 23:38:54 -0500 Subject: [PATCH] winegstreamer: Shut down the read thread before releasing the IMFByteStream. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/winegstreamer/media_source.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index 90efc9aaed2..e153c8e9161 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -1211,6 +1211,13 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) unix_funcs->wg_parser_disconnect(source->wg_parser); + if (source->read_thread) + { + source->read_thread_shutdown = true; + WaitForSingleObject(source->read_thread, INFINITE); + CloseHandle(source->read_thread); + } + if (source->pres_desc) IMFPresentationDescriptor_Release(source->pres_desc); if (source->event_queue) @@ -1234,13 +1241,6 @@ static HRESULT WINAPI media_source_Shutdown(IMFMediaSource *iface) IMFMediaStream_Release(&stream->IMFMediaStream_iface); } - if (source->read_thread) - { - source->read_thread_shutdown = true; - WaitForSingleObject(source->read_thread, INFINITE); - CloseHandle(source->read_thread); - } - unix_funcs->wg_parser_destroy(source->wg_parser); if (source->stream_count)