diff --git a/source/gfx/gfx-source-texture.cpp b/source/gfx/gfx-source-texture.cpp index 1066f117..56b63e25 100644 --- a/source/gfx/gfx-source-texture.cpp +++ b/source/gfx/gfx-source-texture.cpp @@ -30,8 +30,8 @@ streamfx::gfx::source_texture::~source_texture() } } -streamfx::gfx::source_texture::source_texture(streamfx::obs::weak_source child, streamfx::obs::weak_source parent) - : _parent(parent.lock()), _child(child.lock()) +streamfx::gfx::source_texture::source_texture(streamfx::obs::source child, streamfx::obs::source parent) + : _parent(parent), _child(child) { // Verify that 'child' and 'parent' exist. if (!_child || !_parent) { @@ -39,9 +39,9 @@ streamfx::gfx::source_texture::source_texture(streamfx::obs::weak_source child, } // Verify that 'child' does not contain 'parent'. - if (::streamfx::obs::tools::source_find_source(_child, _parent)) { + if (::streamfx::obs::tools::source_find_source(child, parent)) { throw std::runtime_error("Child contains Parent"); - } else if (!obs_source_add_active_child(_parent.get(), _child.get())) { + } else if (!obs_source_add_active_child(parent, child)) { throw std::runtime_error("Child contains Parent"); } diff --git a/source/gfx/gfx-source-texture.hpp b/source/gfx/gfx-source-texture.hpp index 5eae0fc2..dd09f623 100644 --- a/source/gfx/gfx-source-texture.hpp +++ b/source/gfx/gfx-source-texture.hpp @@ -19,6 +19,7 @@ #include "common.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" +#include "obs/obs-source.hpp" #include "obs/obs-weak-source.hpp" #include "warning-disable.hpp" @@ -34,7 +35,7 @@ namespace streamfx::gfx { public: ~source_texture(); - source_texture(streamfx::obs::weak_source child, streamfx::obs::weak_source parent); + source_texture(streamfx::obs::source child, streamfx::obs::source parent); public /*copy*/: source_texture(source_texture const& other) = delete;