From 96d0902dc872c1158f05b9883739032e891c569e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Thu, 16 Jun 2022 17:24:59 +0200 Subject: [PATCH] spa: ffmpeg: set spa_handle_factory::version Initialize the version with the `SPA_VERSION_HANDLE_FACTORY` macro. This way `spa-inspect` can properly inspect the factory. --- spa/plugins/ffmpeg/ffmpeg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spa/plugins/ffmpeg/ffmpeg.c b/spa/plugins/ffmpeg/ffmpeg.c index a39c93d3b..9546dae2b 100644 --- a/spa/plugins/ffmpeg/ffmpeg.c +++ b/spa/plugins/ffmpeg/ffmpeg.c @@ -127,8 +127,12 @@ static const AVCodec *find_codec_by_index(uint32_t index) SPA_EXPORT int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index) { - static struct spa_handle_factory f; static char name[128]; + static struct spa_handle_factory f = { + SPA_VERSION_HANDLE_FACTORY, + .name = name, + .enum_interface_info = ffmpeg_enum_interface_info, + }; #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100) avcodec_register_all(); @@ -149,10 +153,6 @@ int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t f.init = ffmpeg_dec_init; } - f.name = name; - f.info = NULL; - f.enum_interface_info = ffmpeg_enum_interface_info; - *factory = &f; (*index)++;