filter-blur: Reduce log spam on error

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2017-12-14 02:35:47 +01:00
parent 9d4314141a
commit 911f7696bb
2 changed files with 10 additions and 4 deletions

View file

@ -347,17 +347,22 @@ void Filter::Blur::Instance::video_render(gs_effect_t *effect) {
return; return;
} }
if ((baseW <= 0) || (baseH <= 0)) { if ((baseW <= 0) || (baseH <= 0)) {
P_LOG_ERROR("<filter-blur> Instance '%s' has invalid size source '%s'.", if (!m_errorLogged)
obs_source_get_name(m_source), obs_source_get_name(target)); P_LOG_ERROR("<filter-blur> Instance '%s' has invalid size source '%s'.",
obs_source_get_name(m_source), obs_source_get_name(target));
m_errorLogged = true;
obs_source_skip_video_filter(m_source); obs_source_skip_video_filter(m_source);
return; return;
} }
if (!m_primaryRT || !m_technique || !m_effect) { if (!m_primaryRT || !m_technique || !m_effect) {
P_LOG_ERROR("<filter-blur> Instance '%s' is unable to render, either the render target, technique or effect is broken.", if (!m_errorLogged)
obs_source_get_name(m_source), obs_source_get_name(target)); P_LOG_ERROR("<filter-blur> Instance '%s' is unable to render.",
obs_source_get_name(m_source), obs_source_get_name(target));
m_errorLogged = true;
obs_source_skip_video_filter(m_source); obs_source_skip_video_filter(m_source);
return; return;
} }
m_errorLogged = false;
gs_effect_t* defaultEffect = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT); gs_effect_t* defaultEffect = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT);
gs_texture_t *sourceTexture = nullptr; gs_texture_t *sourceTexture = nullptr;

View file

@ -105,6 +105,7 @@ namespace Filter {
double_t m_bilateralSharpness; double_t m_bilateralSharpness;
// Advanced // Advanced
bool m_errorLogged = false;
uint64_t m_colorFormat; uint64_t m_colorFormat;
}; };
}; };