Revision 0a51362b libavutil/log.c
libavutil/log.c | ||
---|---|---|
82 | 82 |
return (*(AVClass**)ptr)->class_name; |
83 | 83 |
} |
84 | 84 |
|
85 |
static void sanitize(uint8_t *line){ |
|
86 |
while(*line){ |
|
87 |
if(*line < 0x08 || (*line > 0x0D && *line < 0x20)) |
|
88 |
*line='?'; |
|
89 |
line++; |
|
90 |
} |
|
91 |
} |
|
92 |
|
|
85 | 93 |
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) |
86 | 94 |
{ |
87 | 95 |
static int print_prefix=1; |
... | ... | |
121 | 129 |
fprintf(stderr, " Last message repeated %d times\n", count); |
122 | 130 |
count=0; |
123 | 131 |
} |
124 |
colored_fputs(av_clip(level>>3, 0, 6), line); |
|
125 | 132 |
strcpy(prev, line); |
133 |
sanitize(line); |
|
134 |
colored_fputs(av_clip(level>>3, 0, 6), line); |
|
126 | 135 |
} |
127 | 136 |
|
128 | 137 |
static void (*av_log_callback)(void*, int, const char*, va_list) = av_log_default_callback; |
Also available in: Unified diff