winegstreamer: Move wg_parser_destroy() to the Unix library.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-02-11 16:18:58 -06:00 committed by Alexandre Julliard
parent 10dde32dc6
commit 9147fefbb2
3 changed files with 19 additions and 17 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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)