changeset 1600:bb0fa675533f libavcodec

only add prefix after \n
author michael
date Mon, 03 Nov 2003 13:58:26 +0000
parents 079239998a38
children a70c07e13e8e
files utils.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
 }