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.
This commit is contained in:
Barnabás Pőcze 2022-06-16 17:24:59 +02:00
parent de5a85d808
commit 96d0902dc8

View file

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