filter-sdf-effects: Fix a crash due to failed rendering

For whatever reason, the initial render target render fails when an async source is being used.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2019-07-27 19:56:59 +02:00
parent 69f9134749
commit e887a53463

View file

@ -127,7 +127,7 @@ void filter::sdf_effects::sdf_effects_factory::on_list_fill()
} }
try { try {
kv.second = std::make_shared<gs::effect>(path); kv.second = std::make_shared<gs::effect>(path);
} catch (std::exception ex) { } catch (std::exception& ex) {
P_LOG_ERROR(LOG_PREFIX "Failed to load effect '%s' (located at '%s') with error(s): %s", kv.first, path, P_LOG_ERROR(LOG_PREFIX "Failed to load effect '%s' (located at '%s') with error(s): %s", kv.first, path,
ex.what()); ex.what());
} }
@ -866,6 +866,11 @@ void filter::sdf_effects::sdf_effects_instance::video_render(gs_effect_t* effect
this->m_output_rendered = true; this->m_output_rendered = true;
} }
if (!this->m_output_texture) {
obs_source_skip_video_filter(this->m_self);
return;
}
gs_eparam_t* ep = gs_effect_get_param_by_name(final_effect, "image"); gs_eparam_t* ep = gs_effect_get_param_by_name(final_effect, "image");
if (ep) { if (ep) {
gs_effect_set_texture(ep, this->m_output_texture->get_object()); gs_effect_set_texture(ep, this->m_output_texture->get_object());