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
1 changed files with 6 additions and 1 deletions

View File

@ -127,7 +127,7 @@ void filter::sdf_effects::sdf_effects_factory::on_list_fill()
}
try {
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,
ex.what());
}
@ -866,6 +866,11 @@ void filter::sdf_effects::sdf_effects_instance::video_render(gs_effect_t* effect
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");
if (ep) {
gs_effect_set_texture(ep, this->m_output_texture->get_object());