summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/av_log.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/av_log.c b/core/av_log.c
index b6cae6f8f8..1331a1fb26 100644
--- a/core/av_log.c
+++ b/core/av_log.c
@@ -103,6 +103,8 @@ static int extract_msg_type_from_ctx(void *ptr)
#define LIB_PREFIX "libav"
#endif
+static bool print_prefix = true;
+
static void mp_msg_av_log_callback(void *ptr, int level, const char *fmt,
va_list vl)
{
@@ -113,8 +115,11 @@ static void mp_msg_av_log_callback(void *ptr, int level, const char *fmt,
if (!mp_msg_test(type, mp_level))
return;
- mp_msg(type, mp_level, "[%s/%s] ", LIB_PREFIX,
- avc ? avc->item_name(ptr) : "?");
+ if (print_prefix) {
+ mp_msg(type, mp_level, "[%s/%s] ", LIB_PREFIX,
+ avc ? avc->item_name(ptr) : "?");
+ }
+ print_prefix = fmt[strlen(fmt) - 1] == '\n';
mp_msg_va(type, mp_level, fmt, vl);
}