[PATCH 1/4] winegstreamer: Disconnect source pins before calling wg_parser_disconnect().

Zebediah Figura zfigura at codeweavers.com
Mon Apr 4 11:50:54 CDT 2022


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/winegstreamer/quartz_parser.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c
index bb7a71283c3..f38a0c16215 100644
--- a/dlls/winegstreamer/quartz_parser.c
+++ b/dlls/winegstreamer/quartz_parser.c
@@ -1629,6 +1629,15 @@ static HRESULT GST_RemoveOutputPins(struct parser *This)
     if (!This->sink_connected)
         return S_OK;
 
+    /* Disconnecting source pins triggers a call to wg_parser_stream_disable().
+     * The stream pointers are no longer valid after wg_parser_disconnect(), so
+     * make sure we disable the streams first. */
+    for (i = 0; i < This->source_count; ++i)
+    {
+        if (This->sources[i])
+            free_source_pin(This->sources[i]);
+    }
+
     wg_parser_disconnect(This->wg_parser);
 
     /* read_thread() needs to stay alive to service any read requests GStreamer
@@ -1637,12 +1646,6 @@ static HRESULT GST_RemoveOutputPins(struct parser *This)
     WaitForSingleObject(This->read_thread, INFINITE);
     CloseHandle(This->read_thread);
 
-    for (i = 0; i < This->source_count; ++i)
-    {
-        if (This->sources[i])
-            free_source_pin(This->sources[i]);
-    }
-
     This->source_count = 0;
     free(This->sources);
     This->sources = NULL;
-- 
2.35.1




More information about the wine-devel mailing list