diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-20 23:30:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-20 23:30:33 +0200 |
commit | 954b5e340e8ea930f13a9ff2f3a7cbf7ccb3d989 (patch) | |
tree | b184fd13d3ec65d442863b6c979b8139e8a8ea88 /libavutil | |
parent | 1a41415b2adcc38d1de4b10ed2f97c2db2036c08 (diff) | |
parent | eaa2d123f0a643664721593d248ece6bcd85f1e6 (diff) | |
download | ffmpeg-954b5e340e8ea930f13a9ff2f3a7cbf7ccb3d989.tar.gz |
Merge commit 'eaa2d123f0a643664721593d248ece6bcd85f1e6'
* commit 'eaa2d123f0a643664721593d248ece6bcd85f1e6':
log: Print a full backtrace along with error messages under Valgrind
Conflicts:
libavutil/log.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/log.c | 11 | ||||
-rw-r--r-- | libavutil/version.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/libavutil/log.c b/libavutil/log.c index b256d07624..b2bc65cd8b 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -47,6 +47,12 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; #define LINE_SZ 1024 +#if HAVE_VALGRIND_VALGRIND_H +#include <valgrind/valgrind.h> +/* this is the log level at which valgrind will output a full backtrace */ +#define BACKTRACE_LOGLEVEL AV_LOG_ERROR +#endif + static int av_log_level = AV_LOG_INFO; static int flags; @@ -334,6 +340,11 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[2].str); sanitize(part[3].str); colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[3].str); + +#if CONFIG_VALGRIND_BACKTRACE + if (level <= BACKTRACE_LOGLEVEL) + VALGRIND_PRINTF_BACKTRACE(""); +#endif end: av_bprint_finalize(part+3, NULL); #if HAVE_PTHREADS diff --git a/libavutil/version.h b/libavutil/version.h index ec3f586ead..18a22952e0 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -57,7 +57,7 @@ #define LIBAVUTIL_VERSION_MAJOR 54 #define LIBAVUTIL_VERSION_MINOR 23 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ |