Zebediah Figura : winegstreamer: Disconnect source pins before calling wg_parser_disconnect().
Alexandre Julliard
julliard at winehq.org
Mon Apr 4 15:37:52 CDT 2022
Module: wine
Branch: master
Commit: db41b2ae238da4a8f73060948e94b8bdc64f64bb
URL: https://source.winehq.org/git/wine.git/?a=commit;h=db41b2ae238da4a8f73060948e94b8bdc64f64bb
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Mon Apr 4 11:50:54 2022 -0500
winegstreamer: Disconnect source pins before calling wg_parser_disconnect().
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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;
More information about the wine-cvs
mailing list