# HG changeset patch # User michael # Date 1067867906 0 # Node ID bb0fa675533fa65a1abd6de6b4129c3686f2e6d2 # Parent 079239998a385917dd84c9ad7caca35fba8d1165 only add prefix after \n diff -r 079239998a38 -r bb0fa675533f utils.c --- a/utils.c Mon Nov 03 13:31:02 2003 +0000 +++ b/utils.c Mon Nov 03 13:58:26 2003 +0000 @@ -780,10 +780,15 @@ static void av_log_default_callback(AVCodecContext* avctx, int level, const char* fmt, va_list vl) { + static int print_prefix=1; + if(level>av_log_level) return; - if(avctx) + if(avctx && print_prefix) fprintf(stderr, "[%s @ %p]", avctx->codec->name, avctx); + + print_prefix= (int)strstr(fmt, "\n"); + vfprintf(stderr, fmt, vl); }