Only do the vsnprintf if the log is actually going to happen

pull/3551/head
Isaac Connor 2022-06-07 17:18:43 -04:00
parent 6b339e2e8a
commit d5d797ddac
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ void log_libav_callback(void *ptr, int level, const char *fmt, va_list vargs) {
Error("Unknown log level %d", level);
}
if (log) {
if (log and (log->level() >= log_level) ) {
char logString[8192];
int length = vsnprintf(logString, sizeof(logString)-1, fmt, vargs);
if (length > 0) {