diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 883bee21a0774d..b1a470d9389625 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -342,9 +342,11 @@ static inline bool too_many_repeated_entries(fstream &logFile, const char *msg, static mutex log_mutex; static const char *last_msg_ptr = nullptr; static int last_char_sum = 0; + static size_t last_len = 0; static int rep_count = 0; int new_sum = sum_chars(output_str); + size_t new_len = strlen(output_str); lock_guard guard(log_mutex); @@ -357,6 +359,8 @@ static inline bool too_many_repeated_entries(fstream &logFile, const char *msg, if (diff < MAX_CHAR_VARIATION) { return (rep_count++ >= MAX_REPEATED_LINES); } + } else if (last_len == new_len && new_sum == last_char_sum) { + return (rep_count++ >= MAX_REPEATED_LINES); } if (rep_count > MAX_REPEATED_LINES) { @@ -366,6 +370,7 @@ static inline bool too_many_repeated_entries(fstream &logFile, const char *msg, last_msg_ptr = msg; last_char_sum = new_sum; + last_len = new_len; rep_count = 0; return false;