From b151a447902e6ed90bb0139aee63f56b5ef20e79 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 2 Dec 2021 17:05:05 +0100 Subject: [PATCH] encoders/ffmpeg: Support proper settings migration --- source/encoders/encoder-ffmpeg.cpp | 6 ++++++ source/encoders/encoder-ffmpeg.hpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/source/encoders/encoder-ffmpeg.cpp b/source/encoders/encoder-ffmpeg.cpp index bf32a0f2..cb44f9f1 100644 --- a/source/encoders/encoder-ffmpeg.cpp +++ b/source/encoders/encoder-ffmpeg.cpp @@ -970,6 +970,12 @@ void ffmpeg_factory::get_defaults2(obs_data_t* settings) } } +void ffmpeg_factory::migrate(obs_data_t* data, uint64_t version) +{ + if (_handler) + _handler->migrate(data, version, _avcodec, nullptr); +} + static bool modified_keyframes(obs_properties_t* props, obs_property_t*, obs_data_t* settings) noexcept try { bool is_seconds = obs_data_get_int(settings, ST_KEY_KEYFRAMES_INTERVALTYPE) == 0; diff --git a/source/encoders/encoder-ffmpeg.hpp b/source/encoders/encoder-ffmpeg.hpp index e882c7d1..ae25553b 100644 --- a/source/encoders/encoder-ffmpeg.hpp +++ b/source/encoders/encoder-ffmpeg.hpp @@ -143,6 +143,8 @@ namespace streamfx::encoder::ffmpeg { void get_defaults2(obs_data_t* data) override; + void migrate(obs_data_t* data, uint64_t version) override; + obs_properties_t* get_properties2(instance_t* data) override; #ifdef ENABLE_FRONTEND