filter-transform: Migration code for earlier stable versions

This fixes #116 which was caused by a refactor in commit efb6b0b9be. This bug was left undiscovered until users started upgrading from the last stable version to the current pre-release.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-03-28 16:18:17 +01:00
parent 4f7c1cb35e
commit 18b3cd30bf

View file

@ -115,9 +115,23 @@ transform::transform_instance::~transform_instance()
void transform::transform_instance::load(obs_data_t* settings)
{
migrate_settings(settings);
update(settings);
}
inline void migrate_settings(obs_data_t* settings)
{
uint64_t version = static_cast<uint64_t>(obs_data_get_int(settings, S_VERSION));
switch (version & STREAMFX_MASK_COMPAT) {
case 0:
obs_data_set_double(settings, ST_ROTATION_X, -obs_data_get_double(settings, ST_ROTATION_X));
obs_data_set_double(settings, ST_ROTATION_Y, -obs_data_get_double(settings, ST_ROTATION_Y));
}
obs_data_set_int(settings, S_VERSION, STREAMFX_VERSION);
}
void transform::transform_instance::update(obs_data_t* settings)
{
// Camera