From 911f7696bb599b749fe2cea1bc68777dd448ddf0 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 14 Dec 2017 02:35:47 +0100 Subject: [PATCH] filter-blur: Reduce log spam on error --- source/filter-blur.cpp | 13 +++++++++---- source/filter-blur.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/source/filter-blur.cpp b/source/filter-blur.cpp index 6f98cb84..61355cda 100644 --- a/source/filter-blur.cpp +++ b/source/filter-blur.cpp @@ -347,17 +347,22 @@ void Filter::Blur::Instance::video_render(gs_effect_t *effect) { return; } if ((baseW <= 0) || (baseH <= 0)) { - P_LOG_ERROR(" Instance '%s' has invalid size source '%s'.", - obs_source_get_name(m_source), obs_source_get_name(target)); + if (!m_errorLogged) + P_LOG_ERROR(" 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); return; } if (!m_primaryRT || !m_technique || !m_effect) { - P_LOG_ERROR(" Instance '%s' is unable to render, either the render target, technique or effect is broken.", - obs_source_get_name(m_source), obs_source_get_name(target)); + if (!m_errorLogged) + P_LOG_ERROR(" 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); return; } + m_errorLogged = false; gs_effect_t* defaultEffect = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT); gs_texture_t *sourceTexture = nullptr; diff --git a/source/filter-blur.h b/source/filter-blur.h index 469849c3..e1c68e35 100644 --- a/source/filter-blur.h +++ b/source/filter-blur.h @@ -105,6 +105,7 @@ namespace Filter { double_t m_bilateralSharpness; // Advanced + bool m_errorLogged = false; uint64_t m_colorFormat; }; };