mirror of https://git.videolan.org/git/ffmpeg.git
only add prefix after \n
Originally committed as revision 2471 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
762357e63a
commit
89b9441aba
|
@ -780,10 +780,15 @@ static int av_log_level = AV_LOG_DEBUG;
|
||||||
|
|
||||||
static void av_log_default_callback(AVCodecContext* avctx, int level, const char* fmt, va_list vl)
|
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)
|
if(level>av_log_level)
|
||||||
return;
|
return;
|
||||||
if(avctx)
|
if(avctx && print_prefix)
|
||||||
fprintf(stderr, "[%s @ %p]", avctx->codec->name, avctx);
|
fprintf(stderr, "[%s @ %p]", avctx->codec->name, avctx);
|
||||||
|
|
||||||
|
print_prefix= (int)strstr(fmt, "\n");
|
||||||
|
|
||||||
vfprintf(stderr, fmt, vl);
|
vfprintf(stderr, fmt, vl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue