Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/gstdemux.c | 18 +----------------- dlls/winegstreamer/wg_parser.c | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 7aaf25e395e..15a20749786 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -210,6 +210,7 @@ struct unix_funcs struct wg_parser *(CDECL *wg_avi_parser_create)(void); struct wg_parser *(CDECL *wg_mpeg_audio_parser_create)(void); struct wg_parser *(CDECL *wg_wave_parser_create)(void); + void (CDECL *wg_parser_destroy)(struct wg_parser *parser); };
extern const struct unix_funcs *unix_funcs; diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index b4f95df67da..db1825e34a1 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1225,22 +1225,6 @@ static struct strmbase_pin *parser_get_pin(struct strmbase_filter *base, unsigne return NULL; }
-static void wg_parser_destroy(struct wg_parser *parser) -{ - if (parser->bus) - { - gst_bus_set_sync_handler(parser->bus, NULL, NULL, NULL); - gst_object_unref(parser->bus); - } - - pthread_mutex_destroy(&parser->mutex); - pthread_cond_destroy(&parser->init_cond); - pthread_cond_destroy(&parser->read_cond); - pthread_cond_destroy(&parser->read_done_cond); - - free(parser); -} - static void parser_destroy(struct strmbase_filter *iface) { struct parser *filter = impl_from_strmbase_filter(iface); @@ -1259,7 +1243,7 @@ static void parser_destroy(struct strmbase_filter *iface) IAsyncReader_Release(filter->reader); filter->reader = NULL;
- wg_parser_destroy(filter->wg_parser); + unix_funcs->wg_parser_destroy(filter->wg_parser);
strmbase_sink_cleanup(&filter->sink); strmbase_filter_cleanup(&filter->filter); diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 3a67a195dff..071694f77cc 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -1011,12 +1011,29 @@ static struct wg_parser * CDECL wg_wave_parser_create(void) return parser; }
+static void CDECL wg_parser_destroy(struct wg_parser *parser) +{ + if (parser->bus) + { + gst_bus_set_sync_handler(parser->bus, NULL, NULL, NULL); + gst_object_unref(parser->bus); + } + + pthread_mutex_destroy(&parser->mutex); + pthread_cond_destroy(&parser->init_cond); + pthread_cond_destroy(&parser->read_cond); + pthread_cond_destroy(&parser->read_done_cond); + + free(parser); +} + static const struct unix_funcs funcs = { wg_decodebin_parser_create, wg_avi_parser_create, wg_mpeg_audio_parser_create, wg_wave_parser_create, + wg_parser_destroy, };
NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out)