Mercurial > libavcodec.hg
comparison utils.c @ 1600:bb0fa675533f libavcodec
only add prefix after \n
| author | michael |
|---|---|
| date | Mon, 03 Nov 2003 13:58:26 +0000 |
| parents | 932d306bf1dc |
| children | a1ac8e675b95 |
comparison
equal
deleted
inserted
replaced
| 1599:079239998a38 | 1600:bb0fa675533f |
|---|---|
| 778 | 778 |
| 779 static int av_log_level = AV_LOG_DEBUG; | 779 static int av_log_level = AV_LOG_DEBUG; |
| 780 | 780 |
| 781 static void av_log_default_callback(AVCodecContext* avctx, int level, const char* fmt, va_list vl) | 781 static void av_log_default_callback(AVCodecContext* avctx, int level, const char* fmt, va_list vl) |
| 782 { | 782 { |
| 783 static int print_prefix=1; | |
| 784 | |
| 783 if(level>av_log_level) | 785 if(level>av_log_level) |
| 784 return; | 786 return; |
| 785 if(avctx) | 787 if(avctx && print_prefix) |
| 786 fprintf(stderr, "[%s @ %p]", avctx->codec->name, avctx); | 788 fprintf(stderr, "[%s @ %p]", avctx->codec->name, avctx); |
| 789 | |
| 790 print_prefix= (int)strstr(fmt, "\n"); | |
| 791 | |
| 787 vfprintf(stderr, fmt, vl); | 792 vfprintf(stderr, fmt, vl); |
| 788 } | 793 } |
| 789 | 794 |
| 790 static void (*av_log_callback)(AVCodecContext*, int, const char*, va_list) = av_log_default_callback; | 795 static void (*av_log_callback)(AVCodecContext*, int, const char*, va_list) = av_log_default_callback; |
| 791 | 796 |
