From e30e692b3640e5e8db4fb5c31445194d1fad31b6 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 23 Feb 2023 13:25:04 +0100 Subject: [PATCH] Print FFmpeg logs FFmpeg logs are redirected to a specific SDL log category. Initialize the log level for this category to print them as expected. --- app/src/util/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/util/log.c b/app/src/util/log.c index ef11d2d1..25b1f26e 100644 --- a/app/src/util/log.c +++ b/app/src/util/log.c @@ -48,6 +48,7 @@ void sc_set_log_level(enum sc_log_level level) { SDL_LogPriority sdl_log = log_level_sc_to_sdl(level); SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, sdl_log); + SDL_LogSetPriority(SDL_LOG_CATEGORY_CUSTOM, sdl_log); } enum sc_log_level @@ -120,7 +121,7 @@ sc_av_log_callback(void *avcl, int level, const char *fmt, va_list vl) { } memcpy(local_fmt, "[FFmpeg] ", 9); // do not write the final '\0' memcpy(local_fmt + 9, fmt, fmt_len + 1); // include '\0' - SDL_LogMessageV(SDL_LOG_CATEGORY_VIDEO, priority, local_fmt, vl); + SDL_LogMessageV(SDL_LOG_CATEGORY_CUSTOM, priority, local_fmt, vl); free(local_fmt); }